| 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()); |