this repo has no description

add zig arena allocator example

kacaii.dev 4a4cf757 a3776d63

verified
+18
+18
zig-arena-allocator.md
···
··· 1 + [[zig.md]] 2 + 3 + ```zig 4 + pub fn init(allocator: std.mem.Allocator) !GameData { 5 + var aa = std.heap.ArenaAllocator.init(allocator); 6 + return .{ 7 + .arena_allocator = aa, 8 + .id_list = try aa.allocator().alloc(u64, 0), 9 + .model_list = try aa.allocator().alloc(Mesh, 0), 10 + .position_x_list = try aa.allocator().alloc(f64, 0), 11 + .position_y_list = try aa.allocator().alloc(f64, 0), 12 + }; 13 + } 14 + 15 + pub fn deinit(self: *GameData) void { 16 + self.arena_allocator.deinit(); 17 + } 18 + ```
zig.md

This is a binary file and will not be displayed.