module: fix removeComponent, add TODO about stack space

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-04-16 19:14:37 -07:00
parent c7f39f0dbe
commit 80780054b5

View file

@ -339,6 +339,7 @@ pub fn Modules(comptime modules: anytype) type {
// TODO: parallel / multi-threaded dispatch // TODO: parallel / multi-threaded dispatch
// TODO: PGO // TODO: PGO
// TODO(important): we may exceed stack space here, consider moving to heap.
var buf: [8 * 1024 * 1024]u8 = undefined; var buf: [8 * 1024 * 1024]u8 = undefined;
while (true) { while (true) {
// Dequeue the next event // Dequeue the next event
@ -530,7 +531,7 @@ pub fn ModSet(comptime modules: anytype) type {
/// Removes an entity. /// Removes an entity.
pub inline fn removeEntity(m: *@This(), entity: EntityID) !void { pub inline fn removeEntity(m: *@This(), entity: EntityID) !void {
try m.entities.removeEntity(entity); try m.entities.remove(entity);
} }
/// Sets the named component to the specified value for the given entity, /// Sets the named component to the specified value for the given entity,