Function queryCapacity [src]
Queries the current memory use of this arena.
This will not include the storage required for internal keeping.
Prototype
pub fn queryCapacity(self: ArenaAllocator) usize
Parameters
self: ArenaAllocator
Source
pub fn queryCapacity(self: ArenaAllocator) usize {
var size: usize = 0;
var it = self.state.buffer_list.first;
while (it) |node| : (it = node.next) {
// Compute the actually allocated size excluding the
// linked list node.
size += node.data - @sizeOf(BufNode);
}
return size;
}