]> git.eshelyaron.com Git - emacs.git/commit
Represent hash table weakness as an enum internally
authorMattias Engdegård <mattiase@acm.org>
Thu, 26 Oct 2023 13:49:32 +0000 (15:49 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 13 Jan 2024 19:50:37 +0000 (20:50 +0100)
commitc6bdc1ea1dc7f9a0b6d92d443f34c42affde73d1
treed913aa29399325b0e1ab08fce48bbaae6eb3068c
parent3f9c81a87f7bce854489b8232d817b536ccf349b
Represent hash table weakness as an enum internally

This takes less space (saves an entire word) and is more type-safe.
No change in behaviour.

* src/lisp.h (hash_table_weakness_t): New.
(struct Lisp_Hash_Table): Replace Lisp object `weak` with enum
`weakness`.
* src/fns.c
(keep_entry_p, hash_table_weakness_symbol): New.
(make_hash_table): Retype argument.  All callers updated.
(sweep_weak_table, Fmake_hash_table, Fhash_table_weakness):
* src/alloc.c (purecopy_hash_table, purecopy, process_mark_stack):
* src/pdumper.c (dump_hash_table):
* src/print.c (print_object): Use retyped field.
14 files changed:
src/alloc.c
src/category.c
src/emacs-module.c
src/fns.c
src/frame.c
src/image.c
src/lisp.h
src/lread.c
src/pdumper.c
src/pgtkterm.c
src/print.c
src/profiler.c
src/xfaces.c
src/xterm.c