D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4677 - disallow GC via cmd line argument -nogc
Summary: disallow GC via cmd line argument -nogc
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-19 02:13 UTC by Stephan Dilly
Modified: 2024-12-13 17:52 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Dilly 2010-08-19 02:13:24 UTC
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 Leandro Lucarella 2010-08-19 08:39:35 UTC
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 Nick Sabalausky 2014-03-25 14:22:11 UTC
There's a pull request for this being worked on and discussed:

https://github.com/D-Programming-Language/dmd/pull/1886
Comment 3 bearophile_hugs 2014-04-25 11:13:18 UTC
We now have both the -vgc switch, and the @nogc attribute. So I think this issue should be closed.
Comment 4 Dmitry Olshansky 2018-05-18 07:57:42 UTC
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 Mike Franklin 2018-05-18 08:07:02 UTC
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 dlangBugzillaToGithub 2024-12-13 17:52:56 UTC
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