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

Method close

Libraries/Await/Await.cpp:225–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225Result 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
248void* AwaitAllocator::allocate(const void* owner, size_t numBytes, size_t alignment)
249{

Callers 1

await_suspendMethod · 0.45

Calls 2

ResultClass · 0.50
ErrorEnum · 0.50

Tested by

no test coverage detected