News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by cmroanirgo on Saturday September 21, 2019 @10:28PM (#21039259)
> latency budgets

The problem with gc is that it can blow out a frame's budget, and perhaps extend for more than one frame, taking away precious nanosecs, dropping a 60fps down to 15.

> what they do in lieu of a garbage collector.

Use reference counting. If in the rare case you need circular references then you use a weak pointer, or reclassify your structure so that it's not circular.

That said, where and how you manage the heap can be critical. I recall a few places where I've used the stack itself as a temporary (small) heap, which all gets cleaned up when you exit the function, taking up almost zero clocks to do so.

Re:Why I Write Games in C (yes, C) by vnorilo on Saturday September 21, 2019 @10:56PM (#21039351)
Reference counting is a form of gc though. It even comes with some nondeterminism in the form of release cascades. Usually performs worse than heap analyzers too, due to hitting atomic counters a lot. The lack of heap overhead and simplicity of implementation are the strong points.