Idea about memory management. Game related.

Tom S h3r3tic at remove.mat.uni.torun.pl
Fri Jun 2 16:45:07 PDT 2006


AgentOrange wrote:
> Thank you Walter, this is all useful information. But what about array
> operations? Should one avoid using D arrays as well?

During the real-time loop, yeah... In my experience, even the most 
innocent memory allocations trigger the GC - and if you have lots of mem 
allocated, you're going to get stalls. There are at least two options here:

1. use malloc for D arrays - an array struct template might be useful
2. bribe Walter with some cookies so he implements std.gc.disable()

And just a quick note: if you use malloc'd arrays to store object 
references, remember to add the array to the GC or your objects will get 
GCd.


-- 
Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d mailing list