diff --git a/src/main.zig b/src/main.zig index 2d2c466..9650d2d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -37,7 +37,10 @@ inline fn get_n_jobs(arg: [:0]const u8) !usize { return n; } -fn get_opts(alloc: std.mem.Allocator) !util.Options { +fn get_opts() !util.Options { + var buff: [100]u8 = undefined; + var fba = std.heap.FixedBufferAllocator.init(&buff); + var alloc = fba.allocator(); var args = try std.process.argsWithAllocator(alloc); defer args.deinit(); _ = args.next(); @@ -51,10 +54,10 @@ fn get_opts(alloc: std.mem.Allocator) !util.Options { } pub fn main() !void { - var arg_buff: [100]u8 = undefined; - var arg_fba = std.heap.FixedBufferAllocator.init(&arg_buff); - const alloc = arg_fba.allocator(); + const opts = get_opts(); - const opts = try get_opts(alloc); + var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); + defer arena.deinit(); + std.debug.print("{any}\n", .{opts}); }