just like mentioned in andrei's interview (http://www.informit.com/articles/article.aspx?p=1622265) i hope to see an dmd command line argument for disabling and disallowing the use of the GC in DMD:
"Walter Bright is considering adding a compile-time flag that would banish all constructs that make implicit use of the GC, in which case you'll know at compile time where the culprits are, and you can change your code accordingly"
Comment #1 by leandro.lucarella — 2010-08-19T08:39:35Z
LDC have even better options, you can forbid any calls to the runtime, which might be very useful for embedded systems or others usages when you only want a "better C" for real low-level stuff.
Comment #2 by bus_dbugzilla — 2014-03-25T14:22:11Z
Comment #3 by bearophile_hugs — 2014-04-25T11:13:18Z
We now have both the -vgc switch, and the @nogc attribute. So I think this issue should be closed.
Comment #4 by dmitry.olsh — 2018-05-18T07:57:42Z
There is also -beterC switch that disallows use of any of DRuntime features and rewries some of common ones to libc-based implementation.
Comment #5 by slavo5150 — 2018-05-18T08:07:02Z
One can also decorate class instances with `scope` which allocates them on the stack instead of the GC.
One can also use `@disable new()` to prevent creating new instances of a type, and instead delegate allocation and construction to factory methods.
Comment #6 by robert.schadek — 2024-12-13T17:52:56Z