]> git.eshelyaron.com Git - emacs.git/commit
Change hash_hash_t to uint32_t
authorMattias Engdegård <mattiase@acm.org>
Wed, 22 Nov 2023 13:54:34 +0000 (14:54 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sat, 13 Jan 2024 19:50:39 +0000 (20:50 +0100)
commit1998039f7a8f2ecc884a6fed85c0cc1ce06f83e2
tree92fb11cd22e2560e637c95cc61c42eff7edfa7d0
parent11e467eb6004286765c1d8c408f8d773d9113aca
Change hash_hash_t to uint32_t

This saves a lot of memory and is quite sufficient.  Hash functions
are adapted to produce a hash_hash_t eventually, which eliminates some
useless and information-destroying intermediate hash reduction steps.

We still use EMACS_UINT for most of the actual hashing steps before
producing the final value; this may be slightly wasteful on 32-bit
platforms with 64-bit EMACS_UINT.

* src/lisp.h (hash_hash_t): Change to uint32_t.
* src/fns.c (reduce_emacs_uint_to_hash_hash): New.
(hashfn_eq, hashfn_equal, hashfn_user_defined): Reduce return values
to hash_hash_t.
(sxhash_string): Remove.  Caller changed to hash_string.
(sxhash_float, sxhash_list, sxhash_vector, sxhash_bool_vector)
(sxhash_bignum): Remove wasteful calls to SXHASH_REDUCE.
(hash_hash_to_fixnum): New.
(Fsxhash_eq, Fsxhash_eql, Fsxhash_equal)
(Fsxhash_equal_including_properties): Convert return values to fixnum.
src/fns.c
src/lisp.h