why GC not work?

safety0ff via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 8 10:15:17 PST 2015


On Sunday, 8 February 2015 at 16:23:44 UTC, FG wrote:
>
>> 2. "auto buf = new byte[](1024*1024*100);"
>>       now the gc can't free this buf.
>>       can i free it by manual?
>
> Yes. import core.memory; GC.free(buf.ptr); // and don't use buf 
> afterwards

That won't work, see:
http://forum.dlang.org/thread/uankmwjejsitmlmrbufe@forum.dlang.org


More information about the Digitalmars-d-learn mailing list