2 ms·
Not talking "hard real time" here, but game code where you want to prevent frame glitches. In C++ you can also replace the allocator to pull items from a pool,
by SomeCallMeTim 11y ago
Not talking "hard real time" here, but game code where you want to prevent frame glitches.
In C++ you can also replace the allocator to pull items from a pool, so that the "allocation" is "grab the first item from the pool linked list" and "deallocation" is "link this item back into the pool." The first case costs two pointer reads and one write, the second case costs two pointer writes and one read.
This lets you use objects as if they're dynamically allocated while still keeping very costs in allocation/deallocation.