Zig doesn’t have a blessed global allocator. Instead, containers in Zig come in two flavors. The “Managed” flavor accepts an allocator as a constructor parameter and stores it as a field (Source). The “Unmanaged” flavor adds an allocator parameter to every method (Source).

From: Call Site Dependency Injection | matklad