@gc attribute for bypassign @nogc

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 25 18:07:27 PDT 2016


On Mon, 25 Jul 2016 15:46:54 +0000, bitwise wrote:

> On Monday, 25 July 2016 at 07:43:34 UTC, rikki cattermole wrote:
>> I've been saying for a very long time we need @assumenogc attribute
>> like we have @trusted for @safe.
> 
> So I'm not crazy then ;)
> 
> I'm wondering if Andrei and Walter consider @trusted a win though. They
> seem to have such firm stances on certain issues that it makes me wonder
> if they consider things like @trusted a liability.
> 
> Personally, I lean way to the side of flexibility, and believe a good
> language shouldn't force you to code a certain way(within reason). I
> feel like this type of feature is very reasonable.
> 
>      Bit

@nogc conflates "doesn't allocate memory from the GC heap because I don't 
want my application to use the GC at all" with "doesn't cause GC 
collection pauses".

The latter can have a @assumenogc annotation that works -- you call 
GC.disable and GC.enable as appropriate. The former can't.


More information about the Digitalmars-d mailing list