summaryrefslogtreecommitdiff
path: root/src/pdumper.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2024-01-19 18:31:06 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2024-01-21 11:21:51 +0100
commit1d754c79603f1b6e4574c7e64c1bf5fb8c6c190d (patch)
tree47ce24109309a12e309cba1717907525fc6fa7ef /src/pdumper.c
parent50201e03b9c4133296dbd10e6c7ebd5dc2a62d50 (diff)
downloademacs-1d754c79603f1b6e4574c7e64c1bf5fb8c6c190d.tar.gz
Change HASH_UNUSED_ENTRY_KEY from Qunbound to NULL float
This removes hacks from code that had to be careful not to use Qunbound as a hash table key, at the cost of a minor hack in the GC marker. * src/lisp.h (INVALID_LISP_VALUE, HASH_UNUSED_ENTRY_KEY): Define as a null-pointer float. * src/alloc.c (process_mark_stack): Add hack to ignore that value. * src/pdumper.c (dump_object_needs_dumping_p) (pdumper_init_symbol_unbound, pdumper_load): * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Remove hacks for Qunbound.
Diffstat (limited to 'src/pdumper.c')
-rw-r--r--src/pdumper.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 4602931b63a..8d030585c83 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -1337,9 +1337,7 @@ dump_object_needs_dumping_p (Lisp_Object object)
included in the dump despite all references to them being
bitwise-invariant. */
return (!dump_object_self_representing_p (object)
- || (dump_object_emacs_ptr (object)
- /* Don't dump Qunbound -- it's not a legal hash table key. */
- && !BASE_EQ (object, Qunbound)));
+ || dump_object_emacs_ptr (object));
}
static void
@@ -2553,19 +2551,6 @@ dump_symbol (struct dump_context *ctx,
return offset;
}
-/* Give Qunbound its name.
- All other symbols are dumped and loaded but not Qunbound because it
- cannot be used as a key in a hash table.
- FIXME: A better solution would be to use a value other than Qunbound
- as a marker for unused entries in hash tables. */
-static void
-pdumper_init_symbol_unbound (void)
-{
- eassert (NILP (SYMBOL_NAME (Qunbound)));
- const char *name = "unbound";
- init_symbol (Qunbound, make_pure_c_string (name, strlen (name)));
-}
-
static dump_off
dump_vectorlike_generic (struct dump_context *ctx,
const union vectorlike_header *header)
@@ -5767,8 +5752,6 @@ pdumper_load (const char *dump_filename, char *argv0)
for (int i = 0; i < nr_dump_hooks; ++i)
dump_hooks[i] ();
- pdumper_init_symbol_unbound ();
-
#ifdef HAVE_NATIVE_COMP
pdumper_set_emacs_execdir (argv0);
#else