| 48 | static bool isPowerOfTwo(size_t value) { return value != 0 and (value & (value - 1)) == 0; } |
| 49 | |
| 50 | static 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 | |
| 65 | static size_t roundUpToAwaitAllocatorPageSize(size_t size) |
| 66 | { |
no outgoing calls
no test coverage detected