ArenaAllocator
An ArenaAllocator allows you to make many allocations and then free them all at once. This is perfect for short-lived tasks or request-based programs.
zig var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const allocator = arena.allocator();
const p1 = try allocator.create(i32); const p2 = try allocator.create(f64); // No need to free p1 and p2 individually!