01 // PROJECT AT A GLANCE
MALLOC
CRewriting malloc and free — then substituting them for the system's, on real programs.
Every program asks the system for memory without ever wondering how that request is satisfied. This project consists in writing that mechanism yourself, then loading it in place of the system's to run real software on top of it. Watching a complete program work on your own allocator is a landmark moment of the curriculum.
A libmy_malloc.so shared library reimplementing malloc, free, calloc, realloc and reallocarray on top of sbrk alone, with best-fit allocation, sizes rounded up to the next power of 2 and the break extended by multiples of two pages, loadable through LD_PRELOAD.
PRIMARYC
DELIVERYTEAM RECORD
VERIFICATIONCriterion
SOURCEINSPECTOR READY
03 // KEY OUTCOMES
- Substitutable for the system allocator on real programs through LD_PRELOAD
- Best-fit strategy and rounding to a power of 2, imposed by the subject
- Debugging silent memory corruption
BEYOND THE BRIEF
- Criterion tests on the allocator, a delicate exercise since the test runs itself with the allocator under test
04 // SOURCE TREE
READING SOURCE…