]> git.eshelyaron.com Git - emacs.git/commit
Store hash values as integers instead of Lisp_Object
authorMattias EngdegÄrd <mattiase@acm.org>
Sun, 29 Oct 2023 10:57:06 +0000 (11:57 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Jan 2024 15:15:41 +0000 (16:15 +0100)
commit9743ba1016f41915d8e7704caabb0f85a92ea1d4
tree5d1c5dc6701e86f852afeb0524c3edd28da62ce9
parentcccf541c0bf61dcad360e2720c30d4e801303a22
Store hash values as integers instead of Lisp_Object

This improves typing, saves pointless tagging and untagging, and
prepares for further changes. The new typedef hash_hash_t is an alias
for EMACS_UINT, and hash values are still limited to the fixnum range.
We now use hash_unused instead of Qnil to mark unused entries.

* src/lisp.h (hash_hash_t): New typedef for EMACS_UINT.
(hash_unused): New constant.
(struct hash_table_test): `hashfn` now returns
hash_hash_t.  All callers and implementations changed.
(struct Lisp_Hash_Table): Retype hash vector to an array of
hash_hash_t.  All code using it changed accordingly.
(HASH_HASH, hash_from_key):
* src/fns.c (set_hash_index_slot, hash_index_index)
(hash_lookup_with_hash, hash_lookup_get_hash, hash_put):
(hash_lookup, hash_put): Retype hash value arguments
and return values.  All callers adapted.

(cherry picked from commit a3ae5653cfe1ab2b3eb4c77ce729844ad442b562)
src/category.c
src/charset.c
src/composite.c
src/emacs-module.c
src/fns.c
src/image.c
src/json.c
src/lisp.h
src/lread.c
src/macfont.m
src/pdumper.c