emacs-devel
[Top][All Lists]
Advanced

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

Re: using finalizers


From: Tomas Hlavaty
Subject: Re: using finalizers
Date: Fri, 31 Dec 2021 10:31:02 +0100

On Fri 31 Dec 2021 at 09:50, Eli Zaretskii <eliz@gnu.org> wrote:
> I think that the assumption that a call to garbage-collect will
> necessarily call the finalizer is also problematic: there's usually no
> simple way to make sure there are no references left to the object,

This breaks my expectations.  Could you explain that more?

I can see these cases where garbage collection might not do its job:

1. imprecise gc

2. program exit or abort

3. a leak to be fixed

What do you have in mind, that could hold extra unexpected references
and not be a leak?

Does it mean that for example thunk-delay leaks even though it releases
the reference to the body thunk?

Does it mean that setting reference to nil in order to dispose an object
(as in my original example) is futile?

> and GC could have its own ideas when to actually garbage-collect an
> object.

I don't think timing is an issue.  I think the expectation from gc is
that it collects the object "eventually as needed".  In the case of
imprecise gc "hopefully eventually as needed".



reply via email to

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