This allocator takes an existing allocator, wraps it, and provides an interface where you can allocate without freeing, and then free it all together.
Functions
fn queryCapacity(self: ArenaAllocator) usize
Queries the current memory use of this arena. This will not include the sto…
Queries the current memory use of this arena. This will not include the storage required for internal keeping.
fn reset(self: *ArenaAllocator, mode: ResetMode) bool
Resets the arena allocator and frees all allocated memory.
Resets the arena allocator and frees all allocated memory.
mode
defines how the currently allocated memory is handled. See the variant documentation forResetMode
for the effects of each mode.The function will return whether the reset operation was successful or not. If the reallocation failed
false
is returned. The arena will still be fully functional in that case, all memory is released. Future allocations just might be slower.NOTE: If
mode
isfree_mode
, the function will always returntrue
.