This project contains simple memory allocator implementations written in C++ for learning purposes.
The goal is to understand how custom memory allocation strategies work internally, how memory can be managed manually, and what trade-offs different allocator types have.
A Linear Allocator, also known as a Bump Allocator, manages a fixed block of memory and allocates memory sequentially from it.
It keeps an internal offset that starts at the beginning of the buffer. When memory is requested, the allocator returns the current position in the buffer and then advances the offset by the requested size.
This makes allocation very fast because it only requires a simple check and an offset increment.
However, individual allocations cannot be freed. Instead, all allocated memory is released at once by resetting the allocator, which moves the offset back to the beginning of the buffer.
This type of allocator is useful when many temporary allocations are needed and can all be discarded together.
The following allocator types are planned or currently in progress:
- Pool Allocator
- Stack Allocator
This project is intended for educational purposes and keeps the implementations simple.
Some production-level features may be missing, such as:
- alignment handling
- copy/move safety
- detailed error handling
- thread safety