MCPcopy Create free account
hub / github.com/apache/impala / CheckIntegrity

Method CheckIntegrity

be/src/runtime/mem-pool.cc:247–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247bool MemPool::CheckIntegrity(bool check_current_chunk_empty) {
248 DCHECK_EQ(zero_length_region_, MEM_POOL_POISON);
249 DCHECK_LT(current_chunk_idx_, static_cast<int>(chunks_.size()));
250
251 // check that current_chunk_idx_ points to the last chunk with allocated data
252 int64_t total_allocated = 0;
253 int64_t total_reserved = 0;
254 for (int i = 0; i < chunks_.size(); ++i) {
255 DCHECK_GT(chunks_[i].size, 0);
256 total_reserved += chunks_[i].size;
257 if (i < current_chunk_idx_) {
258 DCHECK_GT(chunks_[i].allocated_bytes, 0);
259 } else if (i == current_chunk_idx_) {
260 DCHECK_GE(chunks_[i].allocated_bytes, 0);
261 if (check_current_chunk_empty) DCHECK_EQ(chunks_[i].allocated_bytes, 0);
262 } else {
263 DCHECK_EQ(chunks_[i].allocated_bytes, 0);
264 }
265 total_allocated += chunks_[i].allocated_bytes;
266 }
267 DCHECK_EQ(total_allocated, total_allocated_bytes_);
268 DCHECK_EQ(total_reserved, total_reserved_bytes_);
269 return true;
270}

Callers 1

AcquireDataMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected