3 ms·
I'd describe it more as a pool or block allocator. An arena allocator is specifically optimized for incremental allocation and then bulk deallocation (the enti
by sgtnoodle 6y ago
I'd describe it more as a pool or block allocator.
An arena allocator is specifically optimized for incremental allocation and then bulk deallocation (the entire arena is freed at once).
The example code instead appears to create a context of a number of fixed sized blocks. Because of the fixed size, the allocator can make a lot of simplifying assumptions and generally achieve constant time algorithmic complexity, while allowing for individual allocations to be freed and reused.