Componentizing D's garbage collector

Brian Rogoff brogoff at gmail.com
Sun Jan 12 09:12:28 PST 2014


On Sunday, 12 January 2014 at 10:40:50 UTC, Benjamin Thaut wrote:
> Am 12.01.2014 11:27, schrieb Rainer Schuetze:
>>
>> I think a moving collector is currently not feasible without 
>> restricting
>> the language a lot, probably similar to safe D and more. I'm 
>> not sure we
>> want that in general.

I'd rather have more restrictions and a working precise GC, and 
let those who wish to do without the
safety ask for it explicitly.

> Could you give an example which part of the language would not 
> be doable with a moving collector? The only thing that comes to 
> my mind is unions and that problem can be solved by allowing 
> the user to specify manual scanning functions for structs or 
> classes containing unions.

How would the moving GC deal with pointer arithmetic?

> Also I don't think that we can create a GC which performs as 
> good as the one of Java or C# if we are not willing to make the 
> neccessary changes for a moving gc.

I agree. Even ignoring the comparison with Java/C#, I think if D 
is to be a 'fully garbage collected language' then it will have 
to support a state of the art GC.



More information about the Digitalmars-d mailing list