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

Method ReturnPartialAllocation

be/src/runtime/mem-pool.h:159–168  ·  view source on GitHub ↗

Returns 'byte_size' to the current chunk back to the mem pool. This can only be used to return either all or part of the previous allocation returned by Allocate().

Source from the content-addressed store, hash-verified

157 /// only be used to return either all or part of the previous allocation returned
158 /// by Allocate().
159 void ReturnPartialAllocation(int64_t byte_size) {
160 DFAKE_SCOPED_LOCK(mutex_);
161 DCHECK_GE(byte_size, 0);
162 DCHECK(current_chunk_idx_ != -1);
163 ChunkInfo& info = chunks_[current_chunk_idx_];
164 DCHECK_GE(info.allocated_bytes, byte_size);
165 info.allocated_bytes -= byte_size;
166 ASAN_POISON_MEMORY_REGION(info.data + info.allocated_bytes, byte_size);
167 total_allocated_bytes_ -= byte_size;
168 }
169
170 /// Return a dummy pointer for zero-length allocations.
171 static uint8_t* EmptyAllocPtr() {

Callers 3

FlushMethod · 0.80
FinalizeCurrentPageMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64