News for hackers. Stuff that matters.
Re:Memory Management Reference by vitiral on Tuesday July 12, 2022 @04:43PM (#32075419)
You are confounding two subjects: a bump allocator and an arena.

"just increase the pointer" is a bump allocator.

An arena can be used with any allocator, not just bump allocators.

Re:Memory Management Reference by hyperman1 on Wednesday July 13, 2022 @03:28AM (#32079903)
I think apache httpd works like this, and there the 2 subjects are mixed. They have a per-request arena. As it gets destroyed at the end of the request, you can just use a bump allocater which is one of the fastest ways to alloc memory.
Re:Memory Management Reference by foota on Tuesday July 12, 2022 @05:46PM (#32076090)
I think there's two common usages of the term arena, I might call them homogenous and non homogenous. Is there much reason to use a non homogenous arena with something other than a bump allocator?
Re:Memory Management Reference by vitiral on Friday July 15, 2022 @11:22AM (#32109069)
I'm not sure what homogeneous means in this context?

Arenas allow you to not worry about freeing memory, since it will all be freed in a single chunk. It also allows using allocators which are less concerned with fragmentation, since it is known that the arena memory will eventually be dropped.

The amount you are concerned with fragmentation ranges from zero concern (bump allocator) to moderate concern (maybe buddy allocator) to larger concern depends on the application and its tradeoffs, like most things in software engineering.