4 ms·
Is C++ shared pointers the solution? Adding a dead boolean field, then all the entities with links removes their pointers when possible by looking at the dead
by weeber 11y ago
Is C++ shared pointers the solution?
Adding a dead boolean field, then all the entities with links removes their pointers when possible by looking at the dead field, at the end the object is freed.
- ajuc 11y agoGC is the no-sweat solution :) But it's considered too slow (or too unpredictable) for games.
- perdunov 11y agoI think it's quite easy to build a GC-like system for a particular subsystem of the engine. The only nuisance is the lack of reflection in C++, as usual.
- fulafel 11y agoYet most games are written in GC languages (flash, java on android, objc+arc on ios, javascript, C# on unity).
- perdunov 11y agoDo you mean the games that push your hardware to the edge, like DOOM and Quake I-III at the time?