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

Method Free

be/src/udf/udf.cc:410–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410void FunctionContext::Free(uint8_t* buffer) noexcept {
411 assert(!impl_->closed_);
412 if (buffer == NULL) return;
413 VLOG_ROW << "Free: FunctionContext=" << this << " "
414 << reinterpret_cast<void*>(buffer);
415 if (impl_->debug_) {
416 map<uint8_t*, int>::iterator it = impl_->allocations_.find(buffer);
417 if (it != impl_->allocations_.end()) {
418 // fill in garbage value into the buffer to increase the chance of detecting misuse
419 memset(buffer, 0xff, it->second);
420 impl_->allocations_.erase(it);
421 impl_->udf_pool_->Free(buffer);
422 } else {
423 SetError("FunctionContext::Free() called on buffer that is already freed or was "
424 "not allocated.");
425 }
426 } else {
427 impl_->udf_pool_->Free(buffer);
428 }
429}
430
431void FunctionContext::TrackAllocation(int64_t bytes) {
432 assert(!impl_->closed_);

Callers 15

HllSerializeFunction · 0.45
HllFinalizeFunction · 0.45
ValidateMemFunction · 0.45
ValidateSharedStateCloseFunction · 0.45
CloseMethod · 0.45
FreeIntermediateMethod · 0.45
SetMethod · 0.45
MinSerializeFunction · 0.45
MinFinalizeFunction · 0.45
MemTestSerializeFunction · 0.45
MemTestFinalizeFunction · 0.45
CountCloseFunction · 0.45

Calls 6

eraseMethod · 0.80
findMethod · 0.45
endMethod · 0.45
strMethod · 0.45
ReleaseMethod · 0.45
mem_trackerMethod · 0.45

Tested by 14

ValidateMemFunction · 0.36
ValidateSharedStateCloseFunction · 0.36
FreeIntermediateMethod · 0.36
SetMethod · 0.36
MinSerializeFunction · 0.36
MinFinalizeFunction · 0.36
MemTestSerializeFunction · 0.36
MemTestFinalizeFunction · 0.36
CountCloseFunction · 0.36
ConstantArgCloseFunction · 0.36
ValidateOpenCloseFunction · 0.36
BadExprCloseFunction · 0.36