diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-23 17:26:10 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-23 17:26:10 +0200 |
| commit | 8794bca597b6c115a0c3b4b1e7a449c45dfeca1d (patch) | |
| tree | ab9bc9b7e56faf9d07a8897b39eecb948f3aebb1 /src/zisp/gc.zig | |
| parent | 257a051f05deaeb11ec0bc3fdc516620e80dccc6 (diff) | |
Decoder infra.
Diffstat (limited to 'src/zisp/gc.zig')
| -rw-r--r-- | src/zisp/gc.zig | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/zisp/gc.zig b/src/zisp/gc.zig index b2fcc46..0e47682 100644 --- a/src/zisp/gc.zig +++ b/src/zisp/gc.zig @@ -17,22 +17,14 @@ var init_done = false; pub fn init() !void { if (init_done) return; defer init_done = true; - const alloc = std.heap.smp_allocator; - initCustom( - alloc, - try ListPool.init(alloc), - try IstrSet.init(alloc), - ); + main_alloc = std.heap.smp_allocator; + main_list_pool = try ListPool.init(main_alloc); + main_istr_set = try IstrSet.init(main_alloc); } -pub fn initCustom( - alloc: Alloc, - list_pool: ListPool, - istr_set: IstrSet, -) void { - main_alloc = alloc; - main_list_pool = list_pool; - main_istr_set = istr_set; +pub fn mainAlloc() Alloc { + init() catch @panic("OOM"); // TODO this is only here for the test suite + return main_alloc; } pub fn mainListPool() *ListPool { |
