Curriculum Memory Allocators (intro) exercise 5 · fill-word
Allocators (intro)
Fill the missing method name. The Allocator interface
exposes this for releasing memory you allocated earlier. Pass
the slice you got from alloc. Four letters, same as in C.
TypeScript reference
Fill the blanks →
About this theme
Zig has no hidden allocations. Every dynamic alloc goes through an Allocator interface value, and you pick which. The three you meet first: page_allocator (OS page granularity, simple, no bookkeeping), FixedBufferAllocator (a slice of memory you supply, zero heap), and ArenaAllocator (deferred mass-free — drop everything on deinit). The Allocator interface is uniform: alloc, free, dupe, realloc. Pick the allocator that matches the lifetime you want.