const builtin = @import("builtin"); const std = @import("std"); const Alloc = std.mem.Allocator; const value = @import("value.zig"); pub const ListPool = @import("gc/ListPool.zig"); pub const IstrSet = @import("gc/IstrSet.zig"); var main_alloc: Alloc = undefined; var main_list_pool: ListPool = undefined; var main_istr_set: IstrSet = undefined; var init_done = false; pub fn init() !void { if (init_done) return; defer init_done = true; main_alloc = std.heap.smp_allocator; main_list_pool = try ListPool.init(main_alloc); main_istr_set = try IstrSet.init(main_alloc); } pub fn mainAlloc() Alloc { init() catch @panic("OOM"); // TODO this is only here for the test suite return main_alloc; } pub fn mainListPool() *ListPool { init() catch @panic("OOM"); // TODO this is only here for the test suite return &main_list_pool; } pub fn mainIstrSet() *IstrSet { init() catch @panic("OOM"); // TODO this is only here for the test suite return &main_istr_set; }