Implementation of malloc and free, in C.
The code compiles into four shared libraries and six test programs. To build the code, change to your top level assignment directory and type:
make
Once you have the library, you can use it to override the existing malloc by using LD_PRELOAD. The following example shows running the ffnf test using the First Fit shared library:
$ env LD_PRELOAD=lib/libmalloc-ff.so tests/ffnf
To run the other heap management schemes replace libmalloc-ff.so with the appropriate library:
Best-Fit: libmalloc-bf.so
First-Fit: libmalloc-ff.so
Next-Fit: libmalloc-nf.so
Worst-Fit: libmalloc-wf.so