[gclist] Games in C++ with GC? (why malloc/free instead of

Nick Barnes Nick.Barnes@pobox.com
Tue, 18 Feb 2003 10:57:09 +0000


At 2003-02-18 08:42:47+0000, Thomas Johnsson writes:

> Games, espcially 3D games, are often written in C++, using DirectX
> (or OpenGL).  Is there any experience in using GC ()conservative or
> not) in such applications?  Being a sort of real time program, I can
> imagine GC latencies is a potential problem ...  ???

Many games companies these days are using Lua (a very simple embedded
language), which has a very simple stop-and-copy collector. Some games
use other GCed languages or sub-systems.  Some of these games have
latency problems, and some do not.  Some of the latency problems may
be due to the GC, and some may not.  Crash Bandicoot, a PS1 platformer
a few years back, was written in a Lisp dialect.

<http://www.franz.com/success/customer_apps/animation_graphics/naughtydog.lhtml>

However, this is all somewhat theoretical because most games do not
allocate during game play.

The X-Box snowboarding game "Amped" has very bad frame rate problems,
especially in the GUI.  It also uses Lua, especially in the GUI.
Whether these facts are related is unclear.  Other games apparently
use Lua more than Amped does, and yet do not have frame rate problems.

Nick Barnes
Ravenbrook Limited