DConf 2013 Day 2 Talk 5: A Precise Garbage Collector for D by Rainer Schütze

Diggory diggsey at googlemail.com
Thu Jun 6 12:42:46 PDT 2013


Interesting talk. It seems there are a few features D could 
provide which would make for some more powerful GCs:

- Hook for when generating code which reads/writes a pointer 
allowing GC to put in read/write barriers where necessary.

- Hook for union assignment so that the GC could emplace the 
correct type bits

- Hook for passing pointers to extern(XXX) functions so that the 
GC can pin the arguments allowing a compacting GC

- Hook for function call/return so that stack type-info can be 
stored. There's actually another way to do this which would have 
less overhead - at compile time the compiler could write the 
address range of each function along with a bitmap for possible 
pointers in that function to some known location. When the GC 
runs it could unwind the stack and look each frame pointer up in 
the list of functions to find the bit pattern to use. When 
calling a function that does some low-level stuff and might 
prevent the unwinding from working correctly it would be possible 
to switch back to conservative mode until the function returns.


More information about the Digitalmars-d-announce mailing list