[D-runtime] Precise garbage collection

Rainer Schuetze r.sagitario at gmx.de
Mon Jul 1 00:09:58 PDT 2013


On 24.06.2013 20:29, Rainer Schuetze wrote:
> On 24.06.2013 11:19, Leandro Lucarella wrote:
>> I'll repeat what I said in my talk. I think the "rebuild" option is an
>> extremely bad idea.
>
> Especially in the transition to precise GC I would expect one or two
> hickups and everybody will tend to blame the changed GC. It should be
> easy to switch to non-precise GC to verify if the accusation is rectified.
>
>> I used "initialization-time" configurability in CDGC and worked pretty
>> well. It would be much more convenient to have a way to change GC
>> options at source code level too, but I had the same problem, I couldn't
>> find a way to do anything before the GC is initialized. I think being
>> able to configure runtime options via environment variables is an
>> extremely convenient option.
>
> I was thinking about environment variables aswell, but that's not so
> convenient for applications run by non-developers.
>
> One way to do it might be to put configuration variables into a module
> gc.config (it might still read environment variables to change
> defaults). This module is part of the druntime library. If the
> programmer then provides a different gc.config that fulfills all the
> link dependencies, on the link command line, it is preferred over the
> module from the library.
>
> One thing I'll do for sure is to convert versions(GC_PRECISE) to
> if(gc_precise), so it is easy to switch between a configuration variable
> and an enum that allows the optimizer to just remove the disabled parts.

I have pushed the respective changes to the repository, with reading an 
environment variable as the default. Exchanging the module on the linker 
command line also seems to work but expects the init function not to be 
inlined.




More information about the D-runtime mailing list