summaryrefslogtreecommitdiff
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-12-28 19:04:43 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2024-01-12 18:03:02 +0100
commit29e3d1c56f07a53d1955c9a71e68f70f3b901728 (patch)
tree8af3a2032f9e99368dd2a4ac14bacc26be23d9ea /src/emacs-module.c
parent484e04efa4fcb81968cba8e05835812c62856287 (diff)
downloademacs-29e3d1c56f07a53d1955c9a71e68f70f3b901728.tar.gz
emacs-29e3d1c56f07a53d1955c9a71e68f70f3b901728.tar.bz2
emacs-29e3d1c56f07a53d1955c9a71e68f70f3b901728.zip
Abstract predicate and constant for unused hash keys
Qunbound is used for many things; using a predicate and constant for the specific purpose of unused hash entry keys allows us to locate them and make changes much more easily. * src/lisp.h (HASH_UNUSED_ENTRY_KEY, hash_unused_entry_key_p): New constant and function. * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/emacs-module.c (module_global_reference_p): * src/fns.c (make_hash_table, maybe_resize_hash_table, hash_put) (hash_remove_from_table, hash_clear, sweep_weak_table, Fmaphash): * src/json.c (lisp_to_json_nonscalar_1): * src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): * src/print.c (print, print_object): Use them.
Diffstat (limited to 'src/emacs-module.c')
-rw-r--r--src/emacs-module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 46bd732e8eb..283703b3651 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -412,7 +412,7 @@ module_global_reference_p (emacs_value v, ptrdiff_t *n)
reference that's identical to some global reference. */
for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i)
{
- if (!BASE_EQ (HASH_KEY (h, i), Qunbound)
+ if (!hash_unused_entry_key_p (HASH_KEY (h, i))
&& &XMODULE_GLOBAL_REFERENCE (HASH_VALUE (h, i))->value == v)
return true;
}