A free-standing first fit heap implementation in C++. The library is header only and can easily be integrated into other projects.
- gcc >= 4.8
- Linux
- Freestanding
For a Linux project, just include the heap.hpp header where appropriate and add -DHEAP_LINUX to your build configuration.
If you want to use the heap as a freestanding library, e.g. in a operating system kernel or a bare metal application, the following types and functions need to be implemented:
- size_t and uint*_t
- placement new
- heap_max(x, y) returning the x if x > y, and y otherwise
- heap_assert(cond, str) terminating the program if cond == false, continue otherwise