[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12095: Protecting pointer on bytevector with guardian does not prote
From: |
Ludovic Courtès |
Subject: |
bug#12095: Protecting pointer on bytevector with guardian does not protect memory |
Date: |
Mon, 08 Oct 2012 17:42:49 +0200 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Daniel Hartwig <address@hidden> skribis:
> On 8 October 2012 21:44, Ludovic Courtès <address@hidden> wrote:
>>> On 8 October 2012 04:38, Ludovic Courtès <address@hidden> wrote:
>>> Right. But then the pointer is being collected even though it remains
>>> inside the guardian, in the example it is never extracted from there.
>>
>> Well, when the object reaches the guardian’s zombie list, that’s because
>> it’s been finalized, so any weak references from that object can also be
>> nullified.
>
> Ah. So I thought that being in the zombie list prevented any
> finalization, thus when the guardian returns an object it is still
> fully functional and only after the reference is lost again does it
> really get finalized.
Well, the object is still usable when the guardian returns it, because
it’s been kept alive by the finalizer (‘finalize_guarded’ in
guardians.c).
Now, whether weak references from the object are subject to
“nullification” by the GC is clearly a gray area, but I’m not surprised
that it is.
>> How does it help? Should we close the bug? :-)
>
> Sure. At least you seem convinced and you has actually hacked on it :-)
Good. :-)
So closing it now, but feel free to reopen if you think something’s wrong.
Thanks,
Ludo’.