Linear Allocator
The linear or bump allocator is both the fastest simplest possible allocator. Given a buffer of memory it provides a pointer that is moved forward as new data is allocated. The size of the allocator can be either static or determined at run time and accessed from the heap. It does not provide general purpose deallocation and typically must be freed all at once for its memory to be reused.
Overall it optimizes for throughput, alloc and free is simple pointer arithmetic, but not for utilization as memory cannot be reused with out the full memory buffer being freed.
References
- Thinking about allocators and interfaces - cohost post
- Interesting thought about how an allocator interface which does not allow
free
to be called without asserting/failing immediately breaks the contract of the interface & implementation.
- Interesting thought about how an allocator interface which does not allow
- Stanford CS107, Lecture 23 - managing the heap
- Custom Allocators Demystified
- Always bump downward