Componentizing D's garbage collector
Dmitry Olshansky
dmitry.olsh at gmail.com
Tue Jan 14 11:03:04 PST 2014
14-Jan-2014 21:56, Benjamin Thaut пишет:
> Am 14.01.2014 14:42, schrieb Timon Gehr:
>> 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.)
>
> Well no, usually you have to pin objects _before_ passing them to
> C-land. Pinning is not a automatic process its done manually (or by the
> compiler).
If one accepts that any heap can have object that is pinned I don't see
why you need explicit pinning. It just becomes (a complication to) a
part of normal marking stage, the discovery of which objects are pinned.
In semi-precise setting it IMHO makes perfect sense.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list