DIP60: @nogc attribute

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 15 13:46:45 PDT 2014


On Tue, 15 Apr 2014 13:01:40 -0400, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> http://wiki.dlang.org/DIP60
>
> Start on implementation:
>
> https://github.com/D-Programming-Language/dmd/pull/3455

Additional proposal:

In non-release mode, at the start of @nogc function, a thread-local  
variable __nogc is incremented. At the end, __nogc is decremented. Then if  
any GC calls occur when __nogc is nonzero, an error is thrown.

This would be for debugging only, and I'm thinking specifically to prove  
absolutely no hidden compiler-generated GC calls, or calls via extern(C)  
functions occur.

-Steve


More information about the Digitalmars-d mailing list