0PricingLogin
Zig Academy · Lesson

Why Zig Has No Hidden Allocations

Allocation is always passed in.

Memory Is Explicit

In Zig, no standard library function quietly grabs heap memory. If code needs to allocate, it must say so out loud. 📦

You Pass the Allocator

Anything that allocates takes an allocator as a parameter. Memory cannot appear unless you hand a function the tool to make it.

fn buildList(allocator: std.mem.Allocator) !void {}

All lessons in this course

  1. Why Zig Has No Hidden Allocations
  2. The Allocator Interface
  3. alloc, free, create, destroy
  4. Dynamic Lists with ArrayList
← Back to Zig Academy