]> git.eshelyaron.com Git - emacs.git/commit
Leaner hash table dumping and thawing
authorMattias EngdegÄrd <mattiase@acm.org>
Sat, 4 Nov 2023 15:34:09 +0000 (16:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Jan 2024 15:15:38 +0000 (16:15 +0100)
commit19a3cbe0eb8609d99335e02ee4780756efdbc36b
tree2b5bd8bdea1307d7ec0d6ec9f3e8a26de005c1b7
parent120a7a6f4a98e81a150634be87e5601e354d3aa8
Leaner hash table dumping and thawing

Only dump the actual data, and the test encoded as an enum.  This
simplifies dumping, makes dump files smaller and saves space at run
time.

* src/lisp.h (hash_table_std_test_t): New enum.
(struct Lisp_Hash_Table): Add frozen_test member, consuming no extra space.
* src/fns.c (hashfn_user_defined): Now static.
(hash_table_test_from_std): New.
(hash_table_rehash): Rename to...
(hash_table_thaw): ...this and rewrite.
* src/pdumper.c (hash_table_contents): Only include actual data, not
unused space.
(hash_table_std_test): New.
(hash_table_freeze): Set frozen_test from test.
(dump_hash_table): Dump frozen_test, not the whole test struct.
Don't bother other dumping fields that can be derived.

(cherry picked from commit d3cefd3e98354929d96c9396e5920e8a123784dc)
src/fns.c
src/lisp.h
src/pdumper.c