digitalmars.D - Instructions for selecting another GC
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/3) Jun 07 2019 At DConf 2019 someone mentioned that the GC-implementation can
- KnightMare (2/5) Jun 07 2019 r u mean this one? https://dlang.org/spec/garbage.html#gc_config
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (4/5) Jun 07 2019 No, I'm talking about being able to select a completely different
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (5/8) Jun 07 2019 At 49:09 here
- Seb (3/11) Jun 07 2019 See e.g. https://dlang.org/changelog/2.085.0.html#gc_precise for
- KnightMare (3/5) Jun 07 2019 so, the main course is RefCounting with GC for removing cycles..
- kinke (5/7) Jun 11 2019 Rebuilding the compiler shouldn't be necessary, but now you don't
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (45/49) Jun 12 2019 Ok, great.
- kinke (2/5) Jun 12 2019 Try building separately and not using dub to run the executable.
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/4) Jun 19 2019 I found a solution at
- SeanArbogast (2/2) Jun 11 2019 Speaking about the main opportunities to make sure in the
At DConf 2019 someone mentioned that the GC-implementation can now be replaced without recompiling the compiler. How is this accomplished? Is this documented?
Jun 07 2019
On Friday, 7 June 2019 at 17:40:05 UTC, Per Nordlöw wrote:At DConf 2019 someone mentioned that the GC-implementation can now be replaced without recompiling the compiler. How is this accomplished? Is this documented?r u mean this one? https://dlang.org/spec/garbage.html#gc_config
Jun 07 2019
On Friday, 7 June 2019 at 17:52:14 UTC, KnightMare wrote:r u mean this one? https://dlang.org/spec/garbage.html#gc_configNo, I'm talking about being able to select a completely different GC during build time or run-time of my _application_, and not having to rebuild the D compiler.
Jun 07 2019
On Friday, 7 June 2019 at 17:57:31 UTC, Per Nordlöw wrote:No, I'm talking about being able to select a completely different GC during build time or run-time of my _application_, and not having to rebuild the D compiler.At 49:09 here https://www.youtube.com/watch?v=OsOfTVm2ExY&feature=youtu.be&t=2949 Rainzer Schütze mentions the "Open GC Registry". Does he mean that another GC can be selected without rebuilding the compiler?
Jun 07 2019
On Friday, 7 June 2019 at 18:01:46 UTC, Per Nordlöw wrote:On Friday, 7 June 2019 at 17:57:31 UTC, Per Nordlöw wrote:See e.g. https://dlang.org/changelog/2.085.0.html#gc_precise for more details.No, I'm talking about being able to select a completely different GC during build time or run-time of my _application_, and not having to rebuild the D compiler.At 49:09 here https://www.youtube.com/watch?v=OsOfTVm2ExY&feature=youtu.be&t=2949 Rainzer Schütze mentions the "Open GC Registry". Does he mean that another GC can be selected without rebuilding the compiler?
Jun 07 2019
At 49:09 here https://www.youtube.com/watch?v=OsOfTVm2ExY&feature=youtu.be&t=2949so, the main course is RefCounting with GC for removing cycles.. as Swift do for a long time with Apple as maintainer (not for Windows yet)
Jun 07 2019
On Friday, 7 June 2019 at 18:01:46 UTC, Per Nordlöw wrote:Rainzer Schütze mentions the "Open GC Registry". Does he mean that another GC can be selected without rebuilding the compiler?Rebuilding the compiler shouldn't be necessary, but now you don't need to rebuild druntime either and can link your custom GC directly into your binary and instruct druntime to use it: https://dlang.org/spec/garbage.html#gc_registry
Jun 11 2019
On Tuesday, 11 June 2019 at 19:41:00 UTC, kinke wrote:Rebuilding the compiler shouldn't be necessary, but now you don't need to rebuild druntime either and can link your custom GC directly into your binary and instruct druntime to use it: https://dlang.org/spec/garbage.html#gc_registryOk, great. So something like import core.gc.gcinterface, core.gc.registry; import segregated_gc; extern (C) pragma(crt_constructor) void registerSegregatedGC() { registerGCFactory("segregated", &createSegregatedGC); } GC createSegregatedGC() { __gshared instance = new SegregatedGC; instance.initialize(); return instance; } /* The new GC is added to the list of available garbage collectors that can be * selected via the usual configuration options, e.g. by embedding rt_options * into the binary: */ extern (C) __gshared string[] rt_options = ["gcopt=gc:segregated"]; works for me to hardcode the GC by linking my app with https://github.com/nordlow/phobos-next/blob/de1bdaaeac839cbfc65dd8bc7714128f657c19da/benchmarks/gc-benchmark/source/register_segregated_gc.d But in my test suite (at https://github.com/nordlow/phobos-next/blob/de1bdaaeac839cbfc65dd8bc7714128f657c19da/benchmarks/g -benchmark/test.sh) doing dub run --build=release-nobounds -- --DRT-gcopt=gc:conservative dub run --build=release-nobounds -- --DRT-gcopt=gc:precise dub run --build=release-nobounds -- --DRT-gcopt=gc:segregated I don't want to hardcode the `gc:segregated`. Therefore I comment out the line extern (C) __gshared string[] rt_options = ["gcopt=gc:segregated"]; . But then the last call to dub run --build=release-nobounds -- --DRT-gcopt=gc:segregated fails as No GC was initialized, please recheck the name of the selected GC ('segregated'). How do I make a custom GC accessible without hardcoding it to be default and instead being able to select it a run-time via the parameter `--DRT-gcopt`? The above mentioned test can be called by running it locally as ./test.sh
Jun 12 2019
On Wednesday, 12 June 2019 at 12:40:12 UTC, Per Nordlöw wrote:dub run --build=release-nobounds -- --DRT-gcopt=gc:segregated failsTry building separately and not using dub to run the executable.
Jun 12 2019
On Wednesday, 12 June 2019 at 14:22:08 UTC, kinke wrote:Try building separately and not using dub to run the executable.I found a solution at https://github.com/nordlow/phobos-next/blob/52ea7c685fdad3ded9a29fca15cd525b43aeb204/benchmarks/gc-benchmark/test.sh
Jun 19 2019
Speaking about the main opportunities to make sure in the mentioned software, it is necessary to check the modern ones.
Jun 11 2019