chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How should we deal with weak refs to finalizable objects? (was: Re:


From: Peter Bex
Subject: Re: How should we deal with weak refs to finalizable objects? (was: Re: [PATCH] Bugfix and drop weak references to finalizable objects (was: Re: [PATCH] thread-safe handling of asynchronous events))
Date: Thu, 27 Jul 2023 15:48:42 +0200

On Thu, Jul 27, 2023 at 12:30:46PM +0200, Peter Bex wrote:
> 1) There's no (efficient) way to know if an object is a finalizable one.
>    We need this because we can't simply clear *all* the objects inside
>    a finalizable object that aren't referenced elsewhere, because we do
>    want to keep foreign pointers etc which are only referenced by the
>    finalized object itself.  So we'd need an efficient way to know if
>    an object pointed to by a finalizable object is itself finalizable.

Strike that - I think it can be done at the cost of an additional
pointer per finalizer to encode the boundaries of objects that belong to
that finalizer's "reachable set".  But still, that leaves us with #2.

> 2) We have no (canonical) way of breaking strong references.  For weak
>    references, it is clear that we have some special indicator, the
>    "broken weak pointer" placeholder that gets put there when an object
>    reference is cleared.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]