MCPcopy Index your code
hub / github.com/facebook/CacheLib / growPool

Method growPool

cachelib/allocator/memory/MemoryPoolManager.cpp:226–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226bool MemoryPoolManager::growPool(PoolId pid, size_t bytes) {
227 auto& pool = getPoolById(pid);
228
229 std::unique_lock l(lock_);
230 const auto remaining = getRemainingSizeLocked();
231 if (remaining < bytes) {
232 return false;
233 }
234
235 pool.resize(pool.getPoolSize() + bytes);
236 return true;
237}
238
239std::set<PoolId> MemoryPoolManager::getPoolsOverLimit() const {
240 std::set<PoolId> res;

Callers 6

TEST_FFunction · 0.45
TEST_FFunction · 0.45
testGrowWithFreeMemMethod · 0.45
grow_poolFunction · 0.45
TYPED_TESTFunction · 0.45

Calls 2

getPoolSizeMethod · 0.80
resizeMethod · 0.45

Tested by 5

TEST_FFunction · 0.36
TEST_FFunction · 0.36
testGrowWithFreeMemMethod · 0.36
TYPED_TESTFunction · 0.36