Re:Bump Allocation: Up or Down?
by kazinator on Monday March 25, 2024 @11:35PM
(#39824050)
Bump allocation specifically means doing nothing but moving a pointer by a displacement related to the object size.
While "arena allocator" is also used for the same thing, it doesn't exclusive have that meaning. It also refers to region-based memory management in general. An arena allocator can be versatile, allowing objects of different sizes to be freed in any order, and coalesced for new allocation. The arena part of is that the application can throw the whole arena away in one operation.
Bump allocation isn't always used inside arenas that can themselves be allocated or freed. It can be global also. Operating system kernels use such an approach for initialization-time allocation of permanent objects. The classic Unix sbrk() mimics that.
While "arena allocator" is also used for the same thing, it doesn't exclusive have that meaning. It also refers to region-based memory management in general. An arena allocator can be versatile, allowing objects of different sizes to be freed in any order, and coalesced for new allocation. The arena part of is that the application can throw the whole arena away in one operation.
Bump allocation isn't always used inside arenas that can themselves be allocated or freed. It can be global also. Operating system kernels use such an approach for initialization-time allocation of permanent objects. The classic Unix sbrk() mimics that.