What Is an Arena Allocator?
An arena allocator, also called a region or bump allocator, allocates by advancing a pointer through a reserved block, which makes each allocation nearly free. Individual objects are not freed one by one; instead the whole arena is discarded or reset at once. This fits work with a clear shared lifetime, such as handling a single request.
Why it matters
Bulk-freeing an entire arena is far cheaper than tracking and releasing many objects, and it eliminates a class of leaks. The constraint is that everything in the arena shares one lifetime, so it suits phase-based work.
Related guides
What Is a Memory Pool?A memory pool preallocates a block of memory and hands out fixed-size chunks from it, making allocation and r…
What Is a Stack Frame?A stack frame is the block of stack memory for one function call, holding its arguments, local variables, and…
What Is Mark and Sweep?Mark and sweep is a garbage collection algorithm that marks all reachable objects, then sweeps away the unmar…