| 223 | } |
| 224 | |
| 225 | Result AwaitAllocator::close() |
| 226 | { |
| 227 | if (not isOpen()) |
| 228 | { |
| 229 | return Result(true); |
| 230 | } |
| 231 | if (currentStatistics.bytesInUse != 0 or currentStatistics.numAllocations != currentStatistics.numReleases) |
| 232 | { |
| 233 | SC_AWAIT_ASSERT_RELEASE(false); |
| 234 | return Result::Error("AwaitAllocator closed with live allocations"); |
| 235 | } |
| 236 | |
| 237 | releaseVirtualMemory(); |
| 238 | currentMode = AwaitAllocatorMode::None; |
| 239 | fixedStorage = {}; |
| 240 | firstBlock = nullptr; |
| 241 | allocatorInterface = nullptr; |
| 242 | virtualMemory = nullptr; |
| 243 | virtualReservedBytes = 0; |
| 244 | virtualCommittedBytes = 0; |
| 245 | return Result(true); |
| 246 | } |
| 247 | |
| 248 | void* AwaitAllocator::allocate(const void* owner, size_t numBytes, size_t alignment) |
| 249 | { |
no test coverage detected