0PricingLogin
Zig Academy · Lesson

FixedBufferAllocator with No Heap

Allocate from a stack buffer.

Allocate Without the Heap

A FixedBufferAllocator hands out memory from a buffer you already own. No heap, no operating system call, just your own bytes. 🧱

You Supply the Buffer

You start with a plain array, often on the stack. That fixed region is the entire pool the allocator is allowed to give out.

var buffer: [1024]u8 = undefined;

All lessons in this course

  1. GeneralPurposeAllocator for Debug Safety
  2. Arena Allocators for Bulk Free
  3. FixedBufferAllocator with No Heap
  4. Choosing an Allocator per Workload
← Back to Zig Academy