]> git.eshelyaron.com Git - emacs.git/commit
Add DOHASH_SAFE, make DOHASH faster (bug#68690)
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 25 Jan 2024 17:56:03 +0000 (18:56 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jan 2024 20:08:29 +0000 (21:08 +0100)
commit98629066fa6d4f9fc108d4e93c60ab06339506e7
tree340f1ecd3a1af8dcf2169453555b21b372e45258
parent4fee8678083b97643eb8badc5c787299ad395a21
Add DOHASH_SAFE, make DOHASH faster (bug#68690)

Revert DOHASH to the fast (field-caching) implementation but with
an assertion to detect misuses.  Add DOHASH_SAFE for use in
code that must tolerate arbitrary mutation of the table being
iterated through.

* src/lisp.h (DOHASH): Go back to fast design that only allows
restricted mutation, but with a checking assertion.
(DOHASH_SAFE): New macro that tolerates arbitrary mutation while being
much simpler (and acceptably fast).
* src/fns.c (Fmaphash):
* src/comp.c (compile_function, Fcomp__compile_ctxt_to_file):
Use DOHASH_SAFE.

(cherry picked from commit da726c6de201cdb9123bd99e22206dbed5fdc50f)
src/comp.c
src/fns.c
src/lisp.h