Small @nogc experience report

Peter Alexander peter.alexander.au at gmail.com
Sat Sep 8 08:07:07 UTC 2018


On Friday, 7 September 2018 at 17:01:09 UTC, Meta wrote:
> You are allowed to call "@gc" functions inside @nogc functions 
> if you prefix them with a debug statement, e.g.:

Thanks! I was aware that debug is an escape hatch for pure, but 
didn't consider it for @nogc.

> I've been thinking lately that @nogc may have been going to 
> far, and -vgc was all that was actually needed. -vgc gives you 
> the freedom to remove or ignore GC allocations as necessary, 
> instead of @nogc's all or nothing approach.

I was thinking the same thing. The type system is a very 
heavy-weight and intrusive way to enforce something.

I'd love to know if anyone is making good use of @nogc in a 
larger code base and is happy with it. Weka.io?


More information about the Digitalmars-d mailing list