| 490 | } |
| 491 | |
| 492 | MemoryPoolImpl::MemoryPoolImpl( |
| 493 | MemoryManager* memoryManager, |
| 494 | const std::string& name, |
| 495 | Kind kind, |
| 496 | std::shared_ptr<MemoryPool> parent, |
| 497 | std::unique_ptr<MemoryReclaimer> reclaimer, |
| 498 | const Options& options) |
| 499 | : MemoryPool{name, kind, parent, options}, |
| 500 | manager_{memoryManager}, |
| 501 | allocator_{manager_->allocator()}, |
| 502 | arbitrator_{manager_->arbitrator()}, |
| 503 | reclaimer_(std::move(reclaimer)), |
| 504 | // The memory manager sets the capacity through grow() according to the |
| 505 | // actually used memory arbitration policy. |
| 506 | capacity_(parent_ != nullptr ? kMaxMemory : 0) { |
| 507 | BOLT_CHECK(options.threadSafe || isLeaf()); |
| 508 | listener_ = std::make_unique<MemoryAllocationListener>( |
| 509 | name, |
| 510 | this, |
| 511 | options.poolRegex, |
| 512 | options.singleAllocationThreshold, |
| 513 | options.accumulativeAllocationThreshold); |
| 514 | } |
| 515 | |
| 516 | MemoryPoolImpl::~MemoryPoolImpl() { |
| 517 | LEAK_CHECK(); |
nothing calls this directly
no test coverage detected