systems · sub-star
custom_mem_alloc
a memory allocator, built to understand what malloc actually does.
readme
A replacement for malloc written in C. It requests one large contiguous region of virtual memory from the OS up front via mmap, then hands slices of that region to the program itself — maintaining its own free list and splitting blocks on demand, with the bookkeeping overhead kept deliberately small.
signal log
- grabs memory from the OS once with mmap instead of calling the system allocator per request.
- own free-list and block-splitting; reuses freed blocks rather than growing forever.
- [ add how you handle fragmentation — coalescing adjacent free blocks? ]
- [ add a benchmark against system malloc ]
built with
C
view repository →