Garbage collection, and practical strategies to avoid allocation

Benjamin Thaut code at benjamin-thaut.de
Sat Jun 1 04:25:45 PDT 2013


In my eyes there is just one reason there is no better GC yet: It 
requires compiler support.

And thats a huge problem. The number of people who would actually be 
ablte to make the modifications on the compiler in this community is 
very small and they tend to not have much time doing it. A really good 
concurrent GC which properly deals with short lived allocations would 
need the following compiler support.

1) Callback on pointer write (if the pointer is on the heap)
2) Support for percisley scanning the stack
3) Callback on assignment of __shared or static shared variables
4) Callback on cast to shared
5) Callback on new of a shared object

The only thing the compiler already does support is the RTInfo template 
which can be used to percisely scan the heap, but thats not enough for a 
really good GC.

Kind Regards
Benjamin Thaut



More information about the Digitalmars-d mailing list