]> 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)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Jan 2024 15:15:47 +0000 (16:15 +0100)
commit37a975f261a04c50b0fd4b56706a91a0f4e26132
tree1e048ad44349c5863491c35509c4744c60a1cc73
parent151b21ee6c6566c33ee2b07dd044d996db8503fb
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.

(cherry picked from commit 1998039f7a8f2ecc884a6fed85c0cc1ce06f83e2)
src/fns.c
src/lisp.h