DIP60: @nogc attribute

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 15 11:58:25 PDT 2014


On 4/15/2014 11:41 AM, Steven Schveighoffer wrote:
> On Tue, 15 Apr 2014 13:01:40 -0400, Walter Bright <newshound2 at digitalmars.com>
> wrote:
>
>> http://wiki.dlang.org/DIP60'
>
> Wow, that's quite underspecified.

Ok, but I don't see how.


> What about syscalls?

Not sure what you mean by that, but obviously Windows API functions would be @nogc.


> Nothrow functions allow one to call non-nothrow functions,
> but catch all exceptions. What if you want to use the GC for allocation
> temporarily, and then delete all the usage before returning?

@nogc doesn't allow an escape from it. That's the point of it.


> Must you use C malloc/free?

If you can GC/GCfree, then you can use malloc/free.


> What about such code that is @safe, which cannot call free?

There's no point to @nogc if you can still call the GC in it.


More information about the Digitalmars-d mailing list