The only time that I've seen a "GC" used in a C++ game engine was on a games console where the game had to manage VRAM itself (usually your graphics driver does this), so when deleting a VRAM resource, like a texture, it was put into a queue of resources to be released in 2-frames time (to account for GPU latency).
...and this wasn't really a garbage collector, but a garbage queue.
In a multi-threaded game engine that I wrote, when an object's reference count reached zero, it was also put in a queue for deletion, which would occur after a sync point, otherwise another thread could possibly try and access the object after it had been deleted. Again though, this isn't as much a "GC" as a multi-threaded reference counter.
Usually GC's in games only exist in the embedded extension/'scripting' language, like C#/Lua/Python etc...
Show differencesHistory of post edits
#3Hodgman
Posted 23 September 2012 - 11:38 PM
The only time that I've seen a "GC" used in a C++ game engine was on a games console where the game had to manage VRAM itself (usually your graphics driver does this), so when deleting a VRAM resource, like a texture, it was put into a queue of resources to be released in 2-frames time (to account for GPU latency).
...and this wasn't really a garbage collector, but a garbage queue.
In a multi-threaded game engine that I wrote, when an object's reference count reached zero, it was also put in a queue for deletion, which would occur after a sync point, otherwise another thread could possibly try and access the object after it had been deleted. Again though, this isn't as much a "GC" as a multi-threaded reference counter.
...and this wasn't really a garbage collector, but a garbage queue.
In a multi-threaded game engine that I wrote, when an object's reference count reached zero, it was also put in a queue for deletion, which would occur after a sync point, otherwise another thread could possibly try and access the object after it had been deleted. Again though, this isn't as much a "GC" as a multi-threaded reference counter.
#2Hodgman
Posted 23 September 2012 - 11:38 PM
The only time that I've seen a "GC" used in a C++ game engine was on a games console where the game had to manage VRAM itself (usually your graphics driver does this), so when deleting a VRAM resource, like a texture, it was put into a queue of resources to be released in 2-frames time (to account for GPU latency).
...and this wasn't really a garbage collector, but a garbage queue.
In a multi-threaded game engine that I wrote, when an object's reference count reached zero, it was also put in a queue for deletion, which would occur after a sync point, otherwise another thread could possibly try and access the object after it had been deleted. Again though, this isn't as much a "GC" as a multi-threaded reference counter.
...and this wasn't really a garbage collector, but a garbage queue.
In a multi-threaded game engine that I wrote, when an object's reference count reached zero, it was also put in a queue for deletion, which would occur after a sync point, otherwise another thread could possibly try and access the object after it had been deleted. Again though, this isn't as much a "GC" as a multi-threaded reference counter.
#1Hodgman
Posted 23 September 2012 - 11:33 PM
The only time that I've seen a "GC" used in a C++ game engine was on a games console where the game had to managed VRAM itself (usually your graphics driver does this), so when deleting a VRAM resource, like a texture, it was put into a queue of resources to be released in 2-frames time (to account for GPU latency).
...and this wasn't really a garbage collector, but a garbage queue.
...and this wasn't really a garbage collector, but a garbage queue.