GNU bug report logs - #48666
Leaks are still possible in hook--depth-alist

Previous Next

Package: emacs;

Reported by: jakanakaevangeli <at> chiru.no

Date: Wed, 26 May 2021 08:53:02 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: jakanakaevangeli <at> chiru.no
Cc: 48666 <at> debbugs.gnu.org, Daniel Mendler <mail <at> daniel-mendler.de>
Subject: bug#48666: Leaks are still possible in hook--depth-alist
Date: Tue, 22 Feb 2022 10:25:35 -0500
jakanakaevangeli <at> chiru.no [2021-05-26 10:57:47] wrote:
>     (with-temp-buffer
>       (add-hook 'post-command-hook (make-symbol "fun-sym") 77 t))
>     (get 'post-command-hook 'hook--depth-alist)
> Perhaps hook--depth-alist could be a hash table with weak keys.

I just pushed to `master` a patch which should hopefully fix this
problem for good (basically, the depth alist is now kept in an(other)
variable (so for functions added to the buffer-local portion of the
hook, the depth is stored in the buffer-local portion of the depth
variable)).

I hope it will also fix the problems seen in
https://github.com/minad/corfu/issues/133

It makes it a bit harder to check if the old problem is still present or
not, OTOH, because the depth-alist isn't just a quick (get <hook>
'hook--depth-alist) away but you need to (symbol-value (get <hook>
'hook--depth-alist)) and that will only show you the global portion or
the portion relevant to the current buffer.


        Stefan





This bug report was last modified 2 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.