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

Method free

bolt/common/memory/tests/ArbitrationParticipantTest.cpp:279–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277 void free(void* buffer) {
278 size_t size{0};
279 {
280 std::lock_guard<std::mutex> l(mu_);
281 BOLT_CHECK_EQ(allocations_.count(buffer), 1);
282 size = allocations_[buffer];
283 totalBytes_ -= size;
284 allocations_.erase(buffer);
285 }
286 pool_->free(buffer, size);
287 }
288
289 bool reclaimableBytes(const MemoryPool& pool, uint64_t& reclaimableBytes)
290 const {
291 std::lock_guard<std::mutex> l(mu_);
292 BOLT_CHECK_EQ(pool.name(), pool_->name());

Callers 2

reclaimMethod · 0.45
TEST_FFunction · 0.45

Calls 3

swapMethod · 0.80
countMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected