[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/hash-table-perf 9141966be51 09/37: ; * src/alloc.c (purecopy_has
From: |
Mattias Engdegård |
Subject: |
scratch/hash-table-perf 9141966be51 09/37: ; * src/alloc.c (purecopy_hash_table): Simplify |
Date: |
Sun, 7 Jan 2024 12:41:07 -0500 (EST) |
branch: scratch/hash-table-perf
commit 9141966be517f0356fd1ba8586b3dab5b2e2887d
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 36263a89047..53c7c84ec1a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5921,26 +5921,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;
}
- branch scratch/hash-table-perf created (now b9c9539db96), Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 422c91a822a 02/37: ; * src/pdumper.c (dump_hash_table): Remove unused argument., Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf d77c9540363 06/37: Refactor: extract hash computation to a function, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 9f94796b657 05/37: ; * src/fns.c (collect_interval): Move misplaced function., Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 594152bf667 01/37: Add internal hash-table debug functions, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 3d2042c48a6 07/37: Refactor: extract hash index computation to a function, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 9141966be51 09/37: ; * src/alloc.c (purecopy_hash_table): Simplify,
Mattias Engdegård <=
- scratch/hash-table-perf 31950946290 04/37: Refactor: less egregious layering violation in composite.h, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 4e8d7725fd4 11/37: ; * src/fns.c (Fmake_hash_table): ensure `test` is a bare symbol, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 4b5d9f92abe 13/37: * src/print.c (print_object): Don't print empty hash-table data, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 3e9e68333ae 16/37: Remove rehash-threshold and rehash-size struct members, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf c188b9f2bf5 08/37: Refactor hash table vector reallocation, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf fdc390f8dc0 10/37: Abstract predicate and constant for unused hash keys, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 6ffbccbf1dd 15/37: Represent hash table weakness as an enum internally, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf e69035c6ef5 17/37: Leaner hash table dumping and thawing, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf f3e985a16ba 14/37: Don't print or read the hash table size parameter, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf e2a6ce36d83 03/37: Decouple profiler from Lisp hash table internals, Mattias Engdegård, 2024/01/07