
Write arena_alloc and arena_reset, a bump allocator that serves 8-aligned slices of one 4096-byte static pool.
arena_alloc(32) on a fresh arenap align:ok inpool:okarena_alloc(1) then arena_alloc(1)a align:ok inpool:ok
b align:ok inpool:ok
a|b overlap:nonearena_alloc(4096) then arena_alloc(1)full align:ok inpool:ok
extra nullarena_alloc(1) until it refuseschunk1 granted:512
next nullarena_alloc.c<stddef.h>defines size_t
Run the tests to grade your code
Write arena_alloc and arena_reset, a bump allocator that serves 8-aligned slices of one 4096-byte static pool.
arena_alloc(32) on a fresh arenap align:ok inpool:okarena_alloc(1) then arena_alloc(1)a align:ok inpool:ok
b align:ok inpool:ok
a|b overlap:nonearena_alloc(4096) then arena_alloc(1)full align:ok inpool:ok
extra nullarena_alloc(1) until it refuseschunk1 granted:512
next nullarena_alloc.c<stddef.h>defines size_t
Run the tests to grade your code
Memory will appear here