[Issue 15484] core.memory.GC.disable() is not @nogc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 21 08:55:22 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=15484

Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario at gmx.de

--- Comment #3 from Rainer Schuetze <r.sagitario at gmx.de> ---
>  Because @nogc isn't supposed to mean "a GC collection cycle will not be triggered", but rather "no GC code is accessed at all" (which also refers to GC.enable/disable).

My impression is that everybody has a different notion of what @nogc means.
Contrary to your assumption, GC.addRoot and GC.addRange have been marked @nogc.
The spec only says "@nogc applies to functions, and means that that function
does not allocate memory on the GC heap" which still disallows foo() to be
@nogc.

--


More information about the Digitalmars-d-bugs mailing list