Componentizing D's garbage collector

Timon Gehr timon.gehr at gmx.ch
Tue Jan 14 05:42:28 PST 2014


On 01/14/2014 10:20 AM, Benjamin Thaut wrote:
> Am 14.01.2014 09:15, schrieb Jacob Carlborg:
>> On 2014-01-13 22:23, Timon Gehr wrote:
>>
>>> Yes, there is a cost. The requirement to pin arbitrary objects at
>>> arbitrary times, without the possibility to move at pinning time,
>>> invalidates GC algorithms that depend on being able to move _all_
>>> objects within some pool.
>>
>> Can't these object be pinned somewhere else?
>>
>
> Yes, thats the usual approach. But that means that you have to copy them
> to a other space before pinning, or allocate them in a space that allows
> pinning in the first place.

Once it becomes known that an object should be pinned, it is too late 
for moving. (There will then exist a potential pointer to the object.)


More information about the Digitalmars-d mailing list