| 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 | |
| 1442 | void 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 |