how to avoid memory leaking

Benjamin Thaut code at benjamin-thaut.de
Sun May 12 22:00:38 PDT 2013


Instead of the .dup you can use the slice operator []. Although this 
really should not cause a compiler crash if you forgett to do so.

int[3] staticArray;
int[] normalArray = staticArray[];


I'm not seeing something fundamentally wrong with your code right now. I 
will most likely have some more time to look at it tomorrow. Does it use 
any plattform specific features? (E.g. does it work on windows?)

Having a GC does not mean you can not have memory leaks. If you manage 
to keep the memory referenced by some hard rooted reference the GC is 
not allowed to free it and you will get a memory leak. I'm also 
currently not aware of any tools for D that will help you find memory leaks.

Kind Regards
Benjamin Thaut



More information about the Digitalmars-d-learn mailing list