DoxigAlpha

Function parameters

Parameters

#

This allocator takes an existing allocator, wraps it, and provides an interface where

Types

#
ArenaAllocator
This allocator takes an existing allocator, wraps it, and provides an interface where

Source

Implementation

#
pub fn deinit(self: ArenaAllocator) void {
    // NOTE: When changing this, make sure `reset()` is adjusted accordingly!

    var it = self.state.buffer_list.first;
    while (it) |node| {
        // this has to occur before the free because the free frees node
        const next_it = node.next;
        const buf_node: *BufNode = @fieldParentPtr("node", node);
        const alloc_buf = @as([*]u8, @ptrCast(buf_node))[0..buf_node.data];
        self.child_allocator.rawFree(alloc_buf, BufNode_alignment, @returnAddress());
        it = next_it;
    }
}