The objective of the project is to faithfully recreate the malloc system of the library standard C. This repository, contains the complete project code and many tests. The project’s difficulty comes from using the 'MMAP' function and creating three stacks.
Bonuses done
- Memory Hexdump. (show_alloc_mem_ex)
- Thread Safe functions.
- Memory défragmentation.
- Clone Repository
git clone https://github.com/vvaucoul/Malloc && cd Malloc
- Compilation
make
- Tests Compilation
make tests
Replace Malloc system (pay attention to this one)
#!/bin/sh
export LD_LIBRARY_PATH=$PWD
export LD_INSERT_LIBRARIES="libft_malloc.so"
export LD_FORCE_FLAT_NAMESPACE=1
$@
void *malloc(size_t size);
void *realloc(void *ptr, size_t size);
void free(void *ptr);
void show_alloc_mem(void);
void show_alloc_mem_ex(void);