Arena is a stack-like allocator.
In the ABC system, the use of malloc/free
is discouraged.
For larger chunks of RAM, one can use MMAP (almost)directly.
For smaller pieces, there is stack.
There is one popular case inbetween: tons of small pieces that do not fit on the stack.
That is exactly what arenas are for.
- you reserve a piece of RAM (mmap/malloc/whatever),
- you allocate pieces of it for misc uses,
- you free it all at once.
ABC arena is a really thin sugar coating on top of ABC buffers,
specifically Bu8
.