From 91fd65259c423cbc7377c0dc734911380ffb374c Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Tue, 9 Aug 2022 21:27:28 -0700 Subject: [PATCH] zigrtiow: alloc image on heap to enable larger images. --- zigrtiow/src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zigrtiow/src/main.zig b/zigrtiow/src/main.zig index 8b56961..b08480a 100644 --- a/zigrtiow/src/main.zig +++ b/zigrtiow/src/main.zig @@ -106,7 +106,7 @@ pub fn main() anyerror!void { const Node = Queue(Task).Node; const allocator = std.heap.page_allocator; const cpus = try Thread.getCpuCount(); - var pixels: [image_width * image_height]Color = undefined; + var pixels = try allocator.create([image_width * image_height]Color); var q = Queue(Task).init(); var threads: std.ArrayList(std.Thread) = std.ArrayList(std.Thread).init(allocator); var row: usize = 0;