Status on Precise GC
Rainer Schuetze
r.sagitario at gmx.de
Sat Sep 15 09:02:25 PDT 2012
On 08.09.2012 09:07, Rainer Schuetze wrote:
> I happen to have been trying it yesterday and spent the better part of
> the day fixing issues (especially with dynamic arrays). I just noticed
> there are still problems with associative arrays, but I hope I will have
> a pull request today.
>
It took a little longer than I have hoped for, but I have committed a
new branch here: https://github.com/rainers/druntime/tree/precise_gc2
I didn't make it a pull request, because I had to touch almost all of
the precise specific code and change a lot more. It is also rebased to
current druntime-master, so it is easier to try it out.
Associative arrays are a bit troublesome because they emplace keys and
values into memory areas without type information, I guess the gc
interface needs to be extended to support handing pointer information to
the gc. That would also help emplace!T and others.
The garbage collector works with the test suite and Visual D (that means
doesn't crash on Win32, cannot test elsewhere), but unfortunately, it
still doesn't collect everything. A source of trouble is the
pre-initialized data segment, that contains a lot of GUIDs and strings
making good false pointers.
I have a compiler patch to combine all the data that would get a NOSCAN
attribute at runtime into a contiguous region, so that it can be
excluded from scanning, but I would like to exclude more, i.e. the C
runtime library data, noscan areas in TLS and BSS. The compiler still
resists against changes to that respect...
Another option could be to generate pointer bitmaps for the data areas
at compile time into another segment, but I'm not sure whether the
linker could mess up the order in comparison to the actual data segments.
If you like to test it, especially welcome on other platforms, there is
a precisegc_test.d in src/gc that should check the basic runtime info
generation.
Rainer
More information about the Digitalmars-d
mailing list