Componentizing D's garbage collector

Benjamin Thaut code at benjamin-thaut.de
Tue Jan 14 10:00:57 PST 2014


Am 14.01.2014 13:53, schrieb renoX:
> On Tuesday, 14 January 2014 at 11:02:38 UTC, Benjamin Thaut wrote:
>> Am 14.01.2014 11:05, schrieb Walter Bright:
>>> On 1/14/2014 1:18 AM, Benjamin Thaut wrote:
>>>> Current D does not allow a moving collector because of the lack of
>>>> compiler
>>>> support. It is still not possible to identify all pointers percicesly,
>>>> especially those on the stack. Also when you want to implement a
>>>> semi-space GC
>>>> everything _must_ be moveable. Pinning is not an option for a
>>>> semi-space GC.
>>>> There for current D does not allow the implementation of semi-space GC
>>>> without
>>>> some changes to the spec. (E.g. structs / classes containing unions
>>>> _must_
>>>> provide a custom scanning function).
>>>
>>>
>>> This is not true, I've implemented one for Java.
>>
>> So how do you implement a semi-space GC with pinned objects?
>
> You manage the pinned object in a different list that the semi-space list?
>
> It's quite often that GCs maintain object inventory with several
> methods, for example using semi-space for young object but not for old
> objects..
>

I meant a pure semi-space collector. A pure semi-space collector can not 
pin objects. And I didn't make that up, it even says so in "The Garbage 
Collection Handbook".

Pinning Unions is a bad approach anyway in my eyes. Because you will 
have to allocate them in seperate space (which supports pinning) you 
loose the advantge of fast collections for short living objects which a 
semi-space collector provides.


More information about the Digitalmars-d mailing list