Custom C Memory Allocator

Tru Bui

A lightweight malloc/free implementation written in C supporting block splitting, coalescing, boundary tags, segregated free lists, and LD_PRELOAD interposition. Designed to replace glibc's allocator at runtime for real-world testing.

Key Features

Usage

$ gcc -shared -fPIC -o libmymalloc.so myMalloc_sharedlib.c -ldl -pthread
$ LD_PRELOAD=./libmymalloc.so /bin/echo hello
$ LD_PRELOAD=./libmymalloc.so ls -l
    

Technologies & Concepts

Contact me for source code