MCPcopy Create free account
hub / github.com/bytedance/bolt / free

Method free

bolt/common/memory/MemoryPool.cpp:686–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684 bool needRecordFree) {
685 CHECK_AND_INC_MEM_OP_STATS(this, Frees);
686 auto alignmentValue = alignment.has_value() ? alignment.value() : alignment_;
687 const auto alignedSize = sizeAlign(size, alignmentValue);
688 if (needRecordFree) {
689 RECORD_FREE(p, size);
690 }
691 allocator_->freeBytes(p, alignedSize);
692 release(alignedSize);
693}
694
695bool MemoryPoolImpl::transferTo(MemoryPool* dest, void* buffer, uint64_t size) {
696 if (!isLeaf() || !dest->isLeaf()) {
697 return false;
698 }
699 BOLT_CHECK_NOT_NULL(dest);
700 auto* destImpl = checked_pointer_cast<MemoryPoolImpl, MemoryPool>(dest);
701 if (allocator_ != destImpl->allocator_) {
702 return false;

Callers

nothing calls this directly

Calls 3

has_valueMethod · 0.80
valueMethod · 0.45
freeBytesMethod · 0.45

Tested by

no test coverage detected