MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / awaitAllocatorPageSize

Function awaitAllocatorPageSize

Libraries/Await/Await.cpp:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48static bool isPowerOfTwo(size_t value) { return value != 0 and (value & (value - 1)) == 0; }
49
50static size_t awaitAllocatorPageSize()
51{
52#if SC_PLATFORM_WINDOWS
53 static const size_t pageSize = []()
54 {
55 SYSTEM_INFO sysInfo;
56 GetSystemInfo(&sysInfo);
57 return static_cast<size_t>(sysInfo.dwPageSize);
58 }();
59#else
60 static const size_t pageSize = static_cast<size_t>(sysconf(_SC_PAGESIZE));
61#endif
62 return pageSize;
63}
64
65static size_t roundUpToAwaitAllocatorPageSize(size_t size)
66{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected