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

Method setDestructionCallback

bolt/common/memory/MemoryPool.cpp:1436–1446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1434 isRoot(),
1435 "Only root memory pool allows to set destruction callbacks: {}",
1436 name_);
1437 std::lock_guard<std::mutex> l(mutex_);
1438 BOLT_CHECK_NULL(destructionCb_);
1439 destructionCb_ = callback;
1440}
1441
1442void MemoryPoolImpl::testingSetCapacity(int64_t bytes) {
1443 if (parent_ != nullptr) {
1444 return toImpl(parent_)->testingSetCapacity(bytes);
1445 }
1446 std::lock_guard<std::mutex> l(mutex_);
1447 capacity_ = bytes;
1448}
1449

Callers 1

addRootPoolMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected