What can you "new"

Sean Kelly sean at invisibleduck.org
Wed Mar 25 07:48:39 PDT 2009


Denis Koroskin wrote:
> 
> Having a custom memory pool is usually a good idea. At work, our game 
> engine is split into a few separate sub-systems (particle system, 
> physics, animations etc). Since most of them are completely independent 
> (we keep track on their dependencies and trying to cut them as much as 
> possible), it makes sense to have custom memory pools for each of them.

Have you looked into HOARD?  It uses per-process pools, but it's roughly 
the same concept.  Still, for games I can see it being useful to ration 
the memory a subsystem has available via a fixed-size pool.

> More over, if object references don't escape that pool we could have a 
> custom per-pool garbage collector!

We should be able to have the same for D, though a general solution 
would be reliant on the type system to determine which pool to allocate 
from.



More information about the Digitalmars-d mailing list