Curriculum Memory Allocators (intro) exercise 4 · fill-word
Allocators (intro)
Fill the missing method name. The Allocator interface
exposes this for allocating bytes; you pass the element type
and the count, and you get back a slice. Five letters.
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.