DIP60: @nogc attribute

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 02:33:55 PDT 2014


On Thursday, 17 April 2014 at 09:22:55 UTC, Dejan Lekic wrote:
> On Tuesday, 15 April 2014 at 17:01:38 UTC, Walter Bright wrote:
>> http://wiki.dlang.org/DIP60
>>
>> Start on implementation:
>>
>> https://github.com/D-Programming-Language/dmd/pull/3455
>
> This is a good start, but I am sure I am not the only person 
> who thought "maybe we should have this on a module level". This 
> would allow people to nicely group pieces of the application 
> that should not use GC.

Sure it does.

module mymodule;
@nogc:

      void myfunc(){}

      class MyClass {
          void mymethod() {}
      }


Everything in above code has @nogc applied to it.
Nothing special about it, can do it for most attributes like
static, final and UDA's.
Unless of course you can think of another way it could be done? 
Or I've missed something.


More information about the Digitalmars-d mailing list