Disabling GC in D

Dibyendu Majumdar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 15:06:55 PST 2016


On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote:
>> Hi - I want to be sure that my code is not allocating memory 
>> via the GC allocator; but when shipping I don't need to 
>> disable GC - it is mostly a development check.
>> 
>> I want to manage all memory allocation manually via 
>> malloc/free.
>
> Just write "@nogc:" at the top of every module and the compiler 
> will tell you if there's a GC allocation anywhere.
>

Thanks!


More information about the Digitalmars-d-learn mailing list