manual memory management

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 8 17:59:12 PST 2013


On Wed, Jan 09, 2013 at 12:21:05AM +0100, deadalnix wrote:
> On Tuesday, 8 January 2013 at 16:12:41 UTC, Benjamin Thaut wrote:
> >My impression so far: No one who is writing a tripple A gaming
> >title or engine is only remotly interested in using a GC. Game
> >engine programmers almost do anything to get better performance on
> >a certain plattform. There are really elaborate taks beeing done
> >just to get 1% more performance. And because of that, a GC is the
> >very first thing every serious game engine programmer will kick.
> >You have to keep in mind that most games run at 30 FPS. That means
> >you only have 33 ms to do everything. Rendering, simulating
> >physics, doing the game logic, handling network input, playing
> >sounds, streaming data, and so on.
> >Some games even try to get 60 FPS which makes it even harder as
> >you only have 16 ms to compute everything. Everything is
> >performance critical if you try to achive that.
> >
> 
> That is a real misrepresentation of the reality. Such people avoid
> the GC, but simply because they avoid all kind of allocation
> altogether, preferring allocating up-front.

Interesting, that sounds like the heapless programming of the old, old
days where you map out everything beforehand, and limit yourself to use
only what is there. Y'know, with fixed-sized arrays, stacks, etc., fixed
maximum number of objects, etc.. Not a bad approach if you want to
tightly control everything.

Well, except that you do have preallocation, presumably during runtime
at startup (and between game levels, perhaps?), so it's not as rigid,
but during gameplay itself this is pretty much what it amounts to,
right?


T

-- 
Let's not fight disease by killing the patient. -- Sean 'Shaleh' Perry


More information about the Digitalmars-d mailing list