Inner state of ArenaAllocator. Can be stored rather than the entire ArenaAllocator as a memory-saving optimization.
buffer_list: std.SinglyLinkedList(usize) = .{}end_index: usize = 0pub fn promote(self: State, child_allocator: Allocator) ArenaAllocatorpub fn promote(self: State, child_allocator: Allocator) ArenaAllocator {
return .{
.child_allocator = child_allocator,
.state = self,
};
}pub const State = struct {
buffer_list: std.SinglyLinkedList(usize) = .{},
end_index: usize = 0,
pub fn promote(self: State, child_allocator: Allocator) ArenaAllocator {
return .{
.child_allocator = child_allocator,
.state = self,
};
}
}