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

Method freeBytes

bolt/common/memory/MemoryPool.cpp:1296–1310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294 std::lock_guard<std::mutex> l(mutex_);
1295 if (capacity_ == kMaxMemory) {
1296 return 0;
1297 }
1298 if (capacity_ < reservationBytes_) {
1299 // NOTE: the memory reservation could be temporarily larger than its
1300 // capacity if this memory pool is under memory arbitration processing.
1301 return 0;
1302 }
1303 return capacity_ - reservationBytes_;
1304}
1305
1306void MemoryPoolImpl::setReclaimer(std::unique_ptr<MemoryReclaimer> reclaimer) {
1307 BOLT_CHECK_NOT_NULL(reclaimer);
1308 if (parent_ != nullptr) {
1309 BOLT_CHECK_NOT_NULL(
1310 parent_->reclaimer(),
1311 "Child memory pool {} shall only set reclaimer if its parent {} has also set",
1312 name_,
1313 parent_->name());

Callers 11

splitMethod · 0.45
tryEvictMethod · 0.45
initMethod · 0.45
addInputMethod · 0.45
estimateRowSizeMethod · 0.45
usedBytesMethod · 0.45
freeSpaceMethod · 0.45
DEBUG_ONLY_TEST_FFunction · 0.45
newSlabMethod · 0.45
freeMethod · 0.45
maxShrinkCapacityMethod · 0.45

Calls

no outgoing calls

Tested by 1

DEBUG_ONLY_TEST_FFunction · 0.36