Objective
Write a two-function allocator over a 4096-byte static pool: heap_alloc hands out 8-aligned blocks from a free list, heap_free gives one back and merges it with a free neighbour.
Steps
$ p = heap_alloc(32); heap_free(p);
alloc:ok align:ok overlap:none inpool:ok
$ sixteen times heap_alloc(24)
split:ok align:ok overlap:none inpool:ok
$ fill the pool with heap_alloc(256), free two neighbours, heap_alloc(400)
coalesce:ok align:ok overlap:none inpool:ok
$ heap_alloc(0) then heap_alloc(64)
null alloc:ok align:ok overlap:none inpool:ok
$ heap_alloc(SIZE_MAX), heap_alloc(SIZE_MAX - 8), heap_alloc(64)
null null alloc:ok align:ok overlap:none inpool:ok
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Objective
Write a two-function allocator over a 4096-byte static pool: heap_alloc hands out 8-aligned blocks from a free list, heap_free gives one back and merges it with a free neighbour.
Steps
$ p = heap_alloc(32); heap_free(p);
alloc:ok align:ok overlap:none inpool:ok
$ sixteen times heap_alloc(24)
split:ok align:ok overlap:none inpool:ok
$ fill the pool with heap_alloc(256), free two neighbours, heap_alloc(400)
coalesce:ok align:ok overlap:none inpool:ok
$ heap_alloc(0) then heap_alloc(64)
null alloc:ok align:ok overlap:none inpool:ok
$ heap_alloc(SIZE_MAX), heap_alloc(SIZE_MAX - 8), heap_alloc(64)
null null alloc:ok align:ok overlap:none inpool:ok
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Tests
Run the tests to grade your code