-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow enabling GC instead of bump-ptr allocations via command line switch -GC #9210
Conversation
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#9210" |
Oops, the makefiles build via a library so they are hit by #9132. |
@@ -0,0 +1,3 @@ | |||
// REQUIRED_ARGS: -GC -Jrunnable | |||
|
|||
mixin(import("testptrref.d")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this test as testptrref.d
was the only test that failed (for yet unknown reasons) when building the test suite on win64 including phobos unittests. xtest46.d
is just one of the larger test files to cover at least some GC activity.
src/dmd/mars.d
Outdated
{ | ||
// does not support pragma(crt_constructor) yet | ||
import gcc.attribute; | ||
@attribute("section", ".ctors") auto pini = &initGC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ELF specific.
src/dmd/mars.d
Outdated
{ | ||
// does not allow arguments on pragma(crt_constructor) | ||
import ldc.attributes : section; | ||
@section(".ctors") auto pini = &initGC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, ELF specific.
I'm not convinced this (edit: CRT ctor method) is much of an improvement. - I also don't like the |
Are there any benchmarks illustrating reductions in maximum memory usage when compiling typical projects? |
Latest results with LDC are here: ldc-developers/ldc#2916 (comment) |
…ith hacky access to gc.config.config.disable
You are probably right, support for pragma(crt_constructor) varies too much across compilers and platforms. I've now tried a hacky access to gc.config.config.disable with the command line option |
With the introduction of the ProtoGC the GC configuration is initialized too late, so that also doesn't work. |
Alternative to #9048 reusing most of @kinke changes to rmem.d.
Should best be compiled with a recent druntime to reduce memory overhead for GC allocations: dlang/druntime#2384