Hacker News new | ask | show | jobs
by vertex-four 2185 days ago
Because you want garbage collection to happen at specific, well-defined times (i.e. in the slack between frames), in a separate thread - not in the middle of rendering a frame on the main thread when you happen to drop something out of scope.
1 comments

Still I can't imagine GC is the best solution for this. You can easily make a memory allocation strategy that hands out shared_pointers or something like it that get cleaned up at will defined times instead of when it goes out of scope for a user.