From bf351b39e20e32267eaeedc64fc6eb5fcdf7f953 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 18 Sep 2022 07:43:33 -0300 Subject: [PATCH] chore: dont allocate not-small ?Sprite array on stack use memset like most other allocations in this emu --- src/core/ppu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ppu.zig b/src/core/ppu.zig index 904bc86..5c7af70 100644 --- a/src/core/ppu.zig +++ b/src/core/ppu.zig @@ -51,7 +51,7 @@ pub const Ppu = struct { sched.push(.Draw, 240 * 4); const sprites = try allocator.create([128]?Sprite); - sprites.* = [_]?Sprite{null} ** 128; + std.mem.set(?Sprite, sprites, null); return Self{ .vram = try Vram.init(allocator),