Malloc is a C pet-project from 42 course (task is available here).
This project was written to build your own thread-safe allocator (malloc/realloc/free) using system calls and learn some allocation algorithms.
Some info I was inspired by 1.
Some info I was inspired by 2.
void *malloc(size_t size);
void *realloc(void *ptr, size_t size);
void free(void *ptr);
void show_alloc_mem();
void show_mem_hex();
git clone [ref]
git clone --recursive [ref]
make
#
ls -l
lrwxr-xr-x 1 a17641238 staff 29 Apr 22 16:49 libft_malloc.so -> libft_malloc_x86_64_Darwin.so
-rwxr-xr-x 1 a17641238 staff 27680 Apr 22 16:49 libft_malloc_x86_64_Darwin.so
brew install glfw3
brew install cmake
cd Visualizer
cmake . && make
gcc main.c -L$DIR -lft_malloc.so
OR
./run.sh /usr/bin/time -l ./bin # you can inject library by hand.
# start it after the program used libft_malloc.so exited
./AllocViewer