| 213 | } |
| 214 | |
| 215 | bool MemoryPoolManager::shrinkPool(PoolId pid, size_t bytes) { |
| 216 | auto& pool = getPoolById(pid); |
| 217 | |
| 218 | std::unique_lock l(lock_); |
| 219 | if (pool.getPoolSize() < bytes) { |
| 220 | return false; |
| 221 | } |
| 222 | pool.resize(pool.getPoolSize() - bytes); |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool MemoryPoolManager::growPool(PoolId pid, size_t bytes) { |
| 227 | auto& pool = getPoolById(pid); |