Componentizing D's garbage collector

Benjamin Thaut code at benjamin-thaut.de
Mon Jan 13 13:24:38 PST 2014


Am 13.01.2014 18:45, schrieb Dmitry Olshansky:
> 13-Jan-2014 13:20, Rainer Schuetze пишет:
>>
>> Maybe I'm too pessimistic ;-) I guess moving in general could be ok, I
>> was thinking about segregating heaps by type (shared/immutable/mutable)
>> and moving data between them adds restrictions. I'd like to be proven
>> wrong.
>>
>> Some thoughts regarding a moving collector:
>>
>
>> Having to explicitely pin every pointer passed to C functions would be
>> very expensive.
>
> How would it be expensive? I don't see a need to do anything to "pin" a
> memory block, at the time of scanning there will be a potential pointer
> to it (in the stack space of C function or registers).
>

I also don't see how that would be expenive. Pinning is a common pratice 
in other garbage collected languages. But your argument is invalid. As 
the D garbage collector does not have any information about the stack 
frames of the C functions it simply has to ignore those (assuming its a 
truly percise GC).


More information about the Digitalmars-d mailing list