Bug 4677 – disallow GC via cmd line argument -nogc

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-08-19T02:13:24Z
Last change time
2024-12-13T17:52:56Z
Assigned to
No Owner
Creator
Stephan Dilly
Moved to GitHub: dmd#18292 →

Comments

Comment #0 by spam — 2010-08-19T02:13:24Z
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
There's a pull request for this being worked on and discussed: https://github.com/D-Programming-Language/dmd/pull/1886
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18292 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB