DIP60: @nogc attribute

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 17:15:37 PDT 2014


Kapps:

> That code is not @nogc safe, as you're creating a dynamic array 
> within it. The fact that LDC2 at full optimizations doesn't 
> actually allocate is simply an optimization and does not affect 
> the design of the code.

Walter has answered to another person:

> The @nogc will tell you if it will allocate on the gc or not, 
> on a case by case basis, and you can use easy workarounds as 
> necessary.

That can be read as the opposite of what you say. The DIP60 needs 
to contain a clear answer on this point.

Bye,
bearophile


More information about the Digitalmars-d mailing list