Skip to content

Engine → Core

arena.h

Declarations for arena.h.

Classes

File Description
memory::arena Linear (bump) allocator over a chain of fixed-size blocks. Individual allocations are never freed; reset() recycles the whole arena at once, which is what command buffers, parsers and per-load scratch memory want. Addresses are stable until reset() or release(). A request that does not fit in a block gets a dedicated block of its own; the current block keeps serving smaller requests. Blocks are obtained with tracked_allocate, so every acquisition shows up in the allocation counters. Not thread-safe: one arena belongs to one thread (or to a lock held by its owner).

Forward Declarations

memory::arena::block

struct block;

Constants

Name Type Value Description
memory::DEFAULT_ARENA_BLOCK_BYTES inline constexpr usize 64 * KIB Block size an arena uses when the caller does not choose one.