Disabling GC in D

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 14:44:14 PST 2016


On Thu, Jan 21, 2016 at 10:43:31PM +0000, Dibyendu Majumdar via Digitalmars-d-learn wrote:
> On Thursday, 21 January 2016 at 22:34:43 UTC, cym13 wrote:
> >Out of curiosity, why would you force not being able to allocate
> >memory?
> 
> 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.


T

-- 
Tech-savvy: euphemism for nerdy.


More information about the Digitalmars-d-learn mailing list