Heap allocate the entity array

This commit is contained in:
Jared Miller 2025-12-15 10:58:05 -05:00
parent 53d443f480
commit 4bee083cc4

View file

@ -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,
};
}