Revamp how the arena's set up? Maybe?

This commit is contained in:
Lyssieth 2024-12-02 05:16:30 +02:00
parent d54515ff47
commit 684f2717d9
Signed by untrusted user who does not match committer: lyssieth
GPG key ID: 200268854934CFAB

View file

@ -34,10 +34,6 @@ const Globals = struct {
additionalScopes: std.ArrayList(ScopeModifier), additionalScopes: std.ArrayList(ScopeModifier),
fn arena(self: *Globals) std.heap.ArenaAllocator {
return std.heap.ArenaAllocator.init(self.allocator);
}
fn initOrGetFile(self: *Globals) !std.fs.File { fn initOrGetFile(self: *Globals) !std.fs.File {
if (self.outputFile) |file| { if (self.outputFile) |file| {
return file; return file;
@ -145,7 +141,7 @@ fn get() *Globals {
fn logFnImpl(comptime level: Level, comptime scope: Scope, comptime format: []const u8, args: anytype) !void { fn logFnImpl(comptime level: Level, comptime scope: Scope, comptime format: []const u8, args: anytype) !void {
const globals = get(); const globals = get();
var arena = globals.arena(); var arena = std.heap.ArenaAllocator.init(globals.allocator);
var c = cham.initRuntime(.{ var c = cham.initRuntime(.{
.allocator = arena.allocator(), .allocator = arena.allocator(),
}); });