Running out of memory

bearophile bearophileHUGS at lycos.com
Thu Dec 27 07:31:57 PST 2012


FG:

> GC.free(cast(void*)s);

Don't cast arrays arrays to pointers, it's unclean, because 
dynamic arrays are two words long. Use the .ptr property:

GC.free(s.ptr);

Or if the precedent doesn't work:

GC.free(cast(void*)s.ptr);

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list