GNU bug report logs -
#12095
Protecting pointer on bytevector with guardian does not protect memory
Previous Next
Full log
Message #34 received at 12095-done <at> debbugs.gnu.org (full text, mbox):
Daniel Hartwig <mandyke <at> gmail.com> skribis:
> On 8 October 2012 21:44, Ludovic Courtès <ludo <at> gnu.org> wrote:
>>> On 8 October 2012 04:38, Ludovic Courtès <ludo <at> gnu.org> 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’.
This bug report was last modified 12 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.