RFC: Pinning interface for the GC

Alex Rønne Petersen alex at lycus.org
Sat Oct 13 13:12:51 PDT 2012


On 13-10-2012 22:00, David Nadlinger wrote:
> On Saturday, 13 October 2012 at 19:34:29 UTC, Alex Rønne Petersen wrote:
>> There is a difference: Adding the object itself as a root does not
>> actually guarantee that the object *itself* might not be collected. At
>> least, this is how I have to assume things work given that this is not
>> guaranteed here: http://dlang.org/phobos/core_memory.html#addRoot
>
> Actually, it does: the internal array of added roots is simply
> considered an additional range to be scanned by the GC implementation.
> The docs should probably be clarified in this regard.
>
> David

That's good to know.

I'm not convinced that this should be defined behavior though. It 
encourages semantically incorrect use of the API (see my other reply).

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list