DIP60: @nogc attribute
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Thu Apr 17 11:26:24 PDT 2014
On Thursday, 17 April 2014 at 18:18:49 UTC, Ola Fosheim Grøstad
wrote:
> On Thursday, 17 April 2014 at 18:00:25 UTC, Dicebot wrote:
>> Such weak @nogc could help to avoid triggering allocations by
>> an accident and encourage usage of output ranges / buffers.
>
> Ok, more like a "lintish" feature of the "remind me if I use
> too much of feature X in these sections" variety.
>
> I view @nogc as a safeguard against crashes when I let threads
> run while the garbage collector is in a collection phase. A
> means to bypass "stop-the-world" collection by having pure
> @nogc threads.
Yeah for me @nogc is more of a lint thing in general. But it
can't be done by lint because @nogc needs to affect mangling to
work with separate compilation reliably.
I think for your scenario having dedicated @nogc threads makes
more sense, this can be built on top of plain function attribute
@nogc.
More information about the Digitalmars-d
mailing list