DIP60: @nogc attribute

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 23 08:53:36 PDT 2014


On Wed, 23 Apr 2014 05:14:44 -0400, Manu via Digitalmars-d  
<digitalmars-d at puremagic.com> wrote:

> On 23 April 2014 04:28, Steven Schveighoffer via Digitalmars-d
>> ARC does not equal guaranteed memory safety. So NO, it cannot replace  
>> the GC
>> for D @safe code. That doesn't make it useless.
>
> Why not? Assuming that direct access to the refcount is not @safe, why
> would ARC be unsafe? What makes it less safe than the GC?

Arguably, it is safe, as long as you only use ARC pointers. I don't know  
that I would ever want or use that in D (or even Objective-C). So it's not  
that it's not safe, it's that it cannot be a drop-in-replacement for the  
GC in existing D @safe code.

For example, you could never use slices or ranges, or these would have to  
be rewritten to keep references to the full object.

-Steve


More information about the Digitalmars-d mailing list