Arena allocators add the ability to free all allocations in an entire arena with a single call. That means that you don’t have to keep track of allocations made. That can simplify APIs that take and/or produce pointers.
They also allow you to have multiple arenas.
A use case is a web server, where each request creates an arena, allocates scratch memory in it, and destroys the arena after handling the request.
They also allow you to have multiple arenas.
A use case is a web server, where each request creates an arena, allocates scratch memory in it, and destroys the arena after handling the request.