Hacker News new | ask | show | jobs
by pjmlp 4444 days ago
Note that Unreal uses a C++ GC.
2 comments

I'm neither an Unreal nor a C++ expert, but I assume that this kind of GC still allows exact control over when the collection happens since it's not language- but a library feature. In this case this should still be better for game engine purposes, since the GC can for example be hidden behind GPU rendering time.
C++ has a GC API since C++11.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n267...

Currently Visual C++ is the only C++ compiler offering support for it.

As for Unreal, I only know it has one by reading game development foruns. I don't know what type of control it offers.

Totally different from C#:sa GC.

The GC in unreal engine is used to know when what entity should be removed from the game. (If you have multiple entities pointing each other.)

The memory allocation still works how it works in C++.

Well, since C++11, C++ also has a standard minimal GC API, although only VC++ supports it currently.

Thanks for the clarification, as I only knew there was a GC from gamedev articles, forums, without much details.