Given my interest on low-level stuff i decided to build a custom memory allocator written in C, implementing my not so good versions of:
my_malloc– allocate memorymy_calloc– allocate zero-initialized memorymy_realloc– resize allocated memorymy_free– free memoryprint_heap– visualize the heap structure
Supports aligned memory, block splitting, and merging for efficient memory management.
- Fully functional
malloc/calloc/realloc/freereplacements - Heap visualization via
print_heap() - Splitting & merging blocks to reduce fragmentation
- Aligned memory support (16-byte alignment by default)
git clone https://github.com/your-username/custom-allocator.git
cd custom-allocator
gcc start.c my_malloc.c my_calloc.c my_realloc.c helpers.c free.c debug.c -o start
./start