0Pricing
Zig Academy · Lesson

Arena Allocators for Bulk Free

Free everything in one shot.

Free Everything at Once

An ArenaAllocator groups many allocations together so you can release them all in a single step, instead of freeing each one by hand. 🧹

Built on Another Allocator

An arena does not get memory from thin air. You hand it a backing allocator, and the arena requests memory from it in larger chunks.

var arena = std.heap.ArenaAllocator.init(backing_allocator);

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