From 8794bca597b6c115a0c3b4b1e7a449c45dfeca1d Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Tue, 23 Jun 2026 17:26:10 +0200 Subject: Decoder infra. --- src/zisp/gc.zig | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/zisp/gc.zig') 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 { -- cgit v1.2.3