bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#71774: 31.0.50; Hash table weakness broken?


From: Mattias Engdegård
Subject: bug#71774: 31.0.50; Hash table weakness broken?
Date: Wed, 26 Jun 2024 11:39:17 +0200

> Is it possible the problem is fixed by running (setq values nil) before 
> (garbage-collect), or after it, or in between calls to (garbage-collect)? 
> I've not had time to test on current emacs -Q, but on my running emacs 
> session that appears to fix the problem.

Thank you, Pip! It's probably `values` indeed. The effect can also be 
circumvented by not returning the undead object to the REPL:

  (setq h (make-hash-table :weakness 'value))
  -> #s(hash-table weakness value)

  (progn (puthash t (list 3) h) nil)
  -> nil

  h
  -> #s(hash-table weakness value data (t (3)))

  (garbage-collect)

  h
  #s(hash-table weakness value)

> Of course I have no idea why it worked differently in older emacs versions.

It appears to be an effect of Stefan's change 84f72f19, possibly unintended.
Maybe we should take this opportunity to get rid of `values` altogether, or at 
least in `eval-last-sexp`.






reply via email to

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