[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/hash-table-perf 1672d880e0c 29/37: Change hash_idx_t to int32_t
From: |
Mattias Engdegård |
Subject: |
scratch/hash-table-perf 1672d880e0c 29/37: Change hash_idx_t to int32_t on all platforms |
Date: |
Sun, 7 Jan 2024 12:41:22 -0500 (EST) |
branch: scratch/hash-table-perf
commit 1672d880e0c2c6407a7c841ec67920c872977682
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
Change hash_idx_t to int32_t on all platforms
* src/lisp.h (hash_idx_t): Change to int32_t.
* src/fns.c (hash_index_size): Adapt to new index type.
---
src/fns.c | 3 ++-
src/lisp.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/fns.c b/src/fns.c
index 2e5969fdff2..88919a904b6 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4515,7 +4515,8 @@ hash_index_size (ptrdiff_t size)
/* An upper bound on the size of a hash table index. It must fit in
ptrdiff_t and be a valid Emacs fixnum. */
ptrdiff_t upper_bound = min (MOST_POSITIVE_FIXNUM,
- PTRDIFF_MAX / sizeof (ptrdiff_t));
+ min (TYPE_MAXIMUM (hash_idx_t),
+ PTRDIFF_MAX / sizeof (ptrdiff_t)));
ptrdiff_t index_size = size + (size >> 2); /* 1.25x larger */
if (index_size < upper_bound)
index_size = next_almost_prime (index_size);
diff --git a/src/lisp.h b/src/lisp.h
index 083733429ed..0e5e75caa3c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2432,7 +2432,7 @@ verify (FIXNUM_OVERFLOW_P (hash_unused));
/* The type of a hash table index, both for table indices and index
(hash) indices. It's signed and a subtype of ptrdiff_t. */
-typedef ptrdiff_t hash_idx_t;
+typedef int32_t hash_idx_t;
struct Lisp_Hash_Table
{
- scratch/hash-table-perf c4df6041de8 12/37: * src/print.c (print_object): Don't print hash table test if `eql`., (continued)
- scratch/hash-table-perf c4df6041de8 12/37: * src/print.c (print_object): Don't print hash table test if `eql`., Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 2d28042f56a 19/37: Use non-Lisp allocation for internal hash-table vectors, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 54807fee4d0 23/37: Use hash_idx_t for storing hash indices, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf fc68176120f 24/37: Use hash_hash_t for storing hash values, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 310f6584ccb 18/37: Allow zero hash table size, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 8e80d1930e3 20/37: Store hash values as EMACS_UINT instead of Lisp_Object, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 1ebd00f6d0a 21/37: Retype hash interfaces to use EMACS_UINT instead of Lisp fixnum, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 8335891387a 22/37: Inlined and specialised hash table look-up, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf ad3d2f8ed88 25/37: Share hash table test structs, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf e53398ab698 26/37: ; Reorder structs (hash and test), Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 1672d880e0c 29/37: Change hash_idx_t to int32_t on all platforms,
Mattias Engdegård <=
- scratch/hash-table-perf e6defe82569 27/37: Change default hash table size to 8 (from 65), Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 41e37c978e6 28/37: Rework index size and resize factor computations, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 5cf627d70e1 30/37: Don't dump Qunbound, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 8b1b140bed9 32/37: * src/lisp.h (hash_hash_t): Change to uint32_t., Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 830838eb5f3 31/37: Use KEY=Qunbound instead of HASH=hash_unused for unused entries, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 05297736aa6 33/37: Adapt hash functions to produce a hash_hash_t eventually, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 8cd35079f4c 34/37: Don't pretend that hash-table-size is useful, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf e366ae38cd5 36/37: Improved hash-table allocation accounting, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf b9c9539db96 37/37: Change hash range reduction from remainder to multiplication, Mattias Engdegård, 2024/01/07
- scratch/hash-table-perf 681a2877cc2 35/37: Hash-table documentation updates, Mattias Engdegård, 2024/01/07