[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 484e04efa4f 08/11: ; * src/alloc.c (purecopy_hash_table): Simplif
From: |
Mattias Engdegård |
Subject: |
master 484e04efa4f 08/11: ; * src/alloc.c (purecopy_hash_table): Simplify |
Date: |
Fri, 12 Jan 2024 12:04:48 -0500 (EST) |
branch: master
commit 484e04efa4fcb81968cba8e05835812c62856287
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
; * src/alloc.c (purecopy_hash_table): Simplify
Copy the entire struct, then take care of fields needing special
treatment.
---
src/alloc.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/src/alloc.c b/src/alloc.c
index fae76d24189..af9c169a3a0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5891,26 +5891,16 @@ purecopy_hash_table (struct Lisp_Hash_Table *table)
eassert (table->purecopy);
struct Lisp_Hash_Table *pure = pure_alloc (sizeof *pure, Lisp_Vectorlike);
- struct hash_table_test pure_test = table->test;
+ *pure = *table;
+ pure->mutable = false;
- /* Purecopy the hash table test. */
- pure_test.name = purecopy (table->test.name);
- pure_test.user_hash_function = purecopy (table->test.user_hash_function);
- pure_test.user_cmp_function = purecopy (table->test.user_cmp_function);
-
- pure->header = table->header;
- pure->weak = purecopy (Qnil);
+ pure->test.name = purecopy (table->test.name);
+ pure->test.user_hash_function = purecopy (table->test.user_hash_function);
+ pure->test.user_cmp_function = purecopy (table->test.user_cmp_function);
pure->hash = purecopy (table->hash);
pure->next = purecopy (table->next);
pure->index = purecopy (table->index);
- pure->count = table->count;
- pure->next_free = table->next_free;
- pure->purecopy = table->purecopy;
- eassert (!pure->mutable);
- pure->rehash_threshold = table->rehash_threshold;
- pure->rehash_size = table->rehash_size;
pure->key_and_value = purecopy (table->key_and_value);
- pure->test = pure_test;
return pure;
}
- master updated (10cfbda8841 -> 8b7a6d7b6de), Mattias Engdegård, 2024/01/12
- master 22201dde773 03/11: Decouple profiler from Lisp hash table internals, Mattias Engdegård, 2024/01/12
- master 228e9000181 01/11: Add internal hash-table debug functions, Mattias Engdegård, 2024/01/12
- master 8acd89e955f 02/11: ; * src/pdumper.c (dump_hash_table): Remove unused argument., Mattias Engdegård, 2024/01/12
- master 3da324fbd3c 04/11: Refactor: less layering violation in composite.h, Mattias Engdegård, 2024/01/12
- master 0bc13945acb 05/11: ; * src/fns.c (collect_interval): Move misplaced function., Mattias Engdegård, 2024/01/12
- master 43127e5ec11 07/11: Refactor hash table vector reallocation, Mattias Engdegård, 2024/01/12
- master 484e04efa4f 08/11: ; * src/alloc.c (purecopy_hash_table): Simplify,
Mattias Engdegård <=
- master 8b7a6d7b6de 11/11: ; * src/lisp.h (struct Lisp_Hash_Table): Add ASCII art., Mattias Engdegård, 2024/01/12
- master 29e3d1c56f0 09/11: Abstract predicate and constant for unused hash keys, Mattias Engdegård, 2024/01/12
- master 462b3e6ae4e 06/11: Refactor: extract hash and index computations to functions, Mattias Engdegård, 2024/01/12
- master 4b7985db11c 10/11: ; * src/fns.c (Fmake_hash_table): ensure `test` is a bare symbol, Mattias Engdegård, 2024/01/12