]> git.eshelyaron.com Git - emacs.git/commit
Share hash table test structs
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 2 Nov 2023 16:05:26 +0000 (17:05 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Jan 2024 15:15:43 +0000 (16:15 +0100)
commit32b372dedb11d70c069cbcbf442ff9dbe22272e4
treeed5d0b2c7c8366b57a5666818e34a6c0967621e0
parent7e64cd11adc8e0ea54aed348b0d6bffb68241343
Share hash table test structs

This saves several words in the hash table object at the cost of an
indirection at runtime.  This seems to be a gain in overall
performance.

FIXME: We cache hash test objects in a rather clumsy way. A better
solution is sought.

* src/lisp.h (struct Lisp_Hash_Table): Use a pointer to the test
struct.  All references adapted.
* src/alloc.c (garbage_collect):
* src/fns.c (struct hash_table_user_test, hash_table_user_tests)
(mark_fns, get_hash_table_user_test): New state for caching test
structs, and functions managing it.

(cherry picked from commit 7d93a0147a14e14d6964bf93ba11cf494b9d49fd)
15 files changed:
src/alloc.c
src/bytecode.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