]> 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)
committerMattias Engdegård <mattiase@acm.org>
Sat, 13 Jan 2024 19:50:37 +0000 (20:50 +0100)
commitd3cefd3e98354929d96c9396e5920e8a123784dc
treeb0fd45c15faa88216653413229e759444810585d
parentc3d0cc50faf588479db62e20ceabe044dd89e244
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.
src/fns.c
src/lisp.h
src/pdumper.c