diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index 060c6ee..9783ca3 100644 --- a/src/main.zig +++ b/src/main.zig @@ -292,10 +292,8 @@ fn generateCornellBox(allocator: anytype) !Hittable { return .{ .list = .{ .objects = hittable_objects } }; } -pub fn main() !void { - var gpa = std.heap.GeneralPurposeAllocator(.{}){}; - const allocator = gpa.allocator(); - defer std.debug.assert(gpa.deinit() == .ok); +pub fn main(init: std.process.Init) !void { + const allocator = init.gpa; var rng_ = std.Random.DefaultPrng.init(42); const rng = rng_.random(); @@ -403,5 +401,5 @@ pub fn main() !void { // Output var write_buf: [zigimg.io.DEFAULT_BUFFER_SIZE]u8 = undefined; - try image.writeToFilePath(allocator, "out.png", write_buf[0..], .{ .png = .{} }); + try image.writeToFilePath(allocator, init.io, "out.png", write_buf[0..], .{ .png = .{} }); } |
