aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2024-01-22 09:48:48 -0500
committerStefan Monnier2024-01-22 09:48:48 -0500
commit797c688f4ab33a196477fd85f83f7438d113dc7d (patch)
treed136cdb1dae4f6b979205a73eafcbedcc980f789 /src
parent269d3515608e4e91cdd03f90bac9c2a9d5e3d094 (diff)
downloademacs-797c688f4ab33a196477fd85f83f7438d113dc7d.tar.gz
emacs-797c688f4ab33a196477fd85f83f7438d113dc7d.zip
* src/pdumper.c (dump_object_needs_dumping_p): Simplify
(hash_table_contents): Use DOHASH.
Diffstat (limited to 'src')
-rw-r--r--src/pdumper.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 8d030585c83..bff11ada02c 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -1331,13 +1331,7 @@ dump_queue_dequeue (struct dump_queue *dump_queue, dump_off basis)
1331static bool 1331static bool
1332dump_object_needs_dumping_p (Lisp_Object object) 1332dump_object_needs_dumping_p (Lisp_Object object)
1333{ 1333{
1334 /* Some objects, like symbols, are self-representing because they 1334 return !(FIXNUMP (object));
1335 have invariant bit patterns, but sometimes these objects have
1336 associated data too, and these data-carrying objects need to be
1337 included in the dump despite all references to them being
1338 bitwise-invariant. */
1339 return (!dump_object_self_representing_p (object)
1340 || dump_object_emacs_ptr (object));
1341} 1335}
1342 1336
1343static void 1337static void
@@ -2651,7 +2645,6 @@ dump_vectorlike_generic (struct dump_context *ctx,
2651static Lisp_Object * 2645static Lisp_Object *
2652hash_table_contents (struct Lisp_Hash_Table *h) 2646hash_table_contents (struct Lisp_Hash_Table *h)
2653{ 2647{
2654 ptrdiff_t old_size = HASH_TABLE_SIZE (h);
2655 ptrdiff_t size = h->count; 2648 ptrdiff_t size = h->count;
2656 Lisp_Object *key_and_value = hash_table_alloc_bytes (2 * size 2649 Lisp_Object *key_and_value = hash_table_alloc_bytes (2 * size
2657 * sizeof *key_and_value); 2650 * sizeof *key_and_value);
@@ -2660,14 +2653,10 @@ hash_table_contents (struct Lisp_Hash_Table *h)
2660 /* Make sure key_and_value ends up in the same order; charset.c 2653 /* Make sure key_and_value ends up in the same order; charset.c
2661 relies on it by expecting hash table indices to stay constant 2654 relies on it by expecting hash table indices to stay constant
2662 across the dump. */ 2655 across the dump. */
2663 for (ptrdiff_t i = 0; i < old_size; i++) 2656 DOHASH (h, i)
2664 { 2657 {
2665 Lisp_Object key = HASH_KEY (h, i); 2658 key_and_value[n++] = HASH_KEY (h, i);
2666 if (!hash_unused_entry_key_p (key)) 2659 key_and_value[n++] = HASH_VALUE (h, i);
2667 {
2668 key_and_value[n++] = key;
2669 key_and_value[n++] = HASH_VALUE (h, i);
2670 }
2671 } 2660 }
2672 2661
2673 return key_and_value; 2662 return key_and_value;