From 4bee083cc4668b3ec293a75af3250354e2aa5ccc Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Mon, 15 Dec 2025 10:58:05 -0500 Subject: [PATCH] Heap allocate the entity array --- src/sandbox.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sandbox.zig b/src/sandbox.zig index 41ec2e2..f28a1c4 100644 --- a/src/sandbox.zig +++ b/src/sandbox.zig @@ -21,12 +21,14 @@ pub const Entity = struct { pub const MAX_ENTITIES: usize = 1_000_000; pub const Entities = struct { - items: [MAX_ENTITIES]Entity, + items: []Entity, count: usize, + var backing: [MAX_ENTITIES]Entity = undefined; + pub fn init() Entities { return .{ - .items = undefined, + .items = &backing, .count = 0, }; }