MCPcopy Create free account
hub / github.com/bytedance/bolt / numPagesNeeded

Function numPagesNeeded

bolt/common/memory/tests/MemoryPoolTest.cpp:298–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 const MmapAllocator* mmapAllocator,
297 MachinePageCount numPages) {
298 auto& sizeClasses = mmapAllocator->sizeClasses();
299 if (numPages > sizeClasses.back()) {
300 return numPages;
301 }
302 for (auto& sizeClass : sizeClasses) {
303 if (sizeClass >= numPages) {
304 return sizeClass;
305 }
306 }
307 BOLT_UNREACHABLE();
308}
309
310void testMmapMemoryAllocation(
311 int64_t capacity,
312 MachinePageCount allocPages,
313 size_t allocCount,
314 bool threadSafe) {

Callers 1

testMmapMemoryAllocationFunction · 0.85

Calls 1

backMethod · 0.80

Tested by

no test coverage detected