Re:Garbage Collectors Are Scary
by npalli on Sunday May 12, 2024 @08:40AM
(#40333958)
GC and AAA probably C#.
[ Parent
| on HN ]
Re:Garbage Collectors Are Scary
by mike_hearn on Sunday May 12, 2024 @09:16AM
(#40334200)
If C# they'd have been using the MS authored GC. It was probably a custom GC for C++ heaps. Quite a few games do this, it's a smart productivity hack. Unreal uses a simple form of mark/sweep GC for its C++ game state heap.
https://unrealcommunity.wiki/garbage-collection-36d1da
It works fine because most RAM in games is consumed by assets that don't need to be scanned.
Interesting fact: Unity doesn't use a Microsoft GC, or the Microsoft implementation of CLR.
They had integrated the competing Mono implementation early on, and it came with its own "stop the world" Boehm GC.
They've been trying to move to Microsoft runtime for years but it's slow going.
Re:Garbage Collectors Are Scary
by neonsunset on Sunday May 12, 2024 @10:00AM
(#40334560)
Unlikely. Though in the case of Unity, this can happen if you fail to uphold memory layout expectations when writing C/C++ code (or if you do something really bad in C#).
There would also be a debugger allowing to reproduce and catch this in an easier way.