Syntax for heap allocated void initialized arrays

bearophile bearophileHUGS at lycos.com
Sat Sep 21 07:23:07 PDT 2013


simendsjo:

> I'm setting every element in the array, and every field of the
> element, so I should be safe, right?

I think that's sufficiently safe. If the GC run before you have 
initialized those fields, and some of those fields are 
references/pointers, that could cause memory leaks until the next 
time the GC runs.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list