The "no gc" crowd

Adam D. Ruppe destructionator at gmail.com
Tue Oct 8 15:45:49 PDT 2013


On Tuesday, 8 October 2013 at 22:37:28 UTC, Walter Bright wrote:
> Every function an @nogc function calls will also have to be 
> @nogc.

Eh, not necessarily. If it expands to static 
assert(!__traits(hasAnnotationRecursive, uses_gc));, then the 
only ones that *need* to be marked are the lowest level ones. 
Then it figures out the rest only on demand.

Then, on the function you care about as a user, you say nogc and 
it tells you if you called anything and the static assert 
stacktrace tells you where it happened.

Of course, to be convenient to use, phobos would need to offer 
non-allocating functions, which is indeed a fair amount of work, 
but they wouldn't *necessarily* have to have the specific 
attribute.


More information about the Digitalmars-d mailing list