A minimal bump allocator in C demonstrating memory alignment and arena-style allocation.
- why alignment matters (x86 slows down, ARM crashes on misaligned access)
- how
sbrk/brkwork to grow and reset the heap - internal fragmentation from padding to alignment boundaries
- arena reset — free everything at once by rewinding the heap pointer
make
make run
after allocator_reset(), any previously allocated pointers (a, b) are dangling, accessing them is undefined behavior. this is the tradeoff of arena allocation.
blog post: Why raw pointers can betray you