diff options
| author | Mattias EngdegÄrd | 2023-11-21 19:26:23 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2024-01-13 20:50:38 +0100 |
| commit | 68f8bc3111424527205ebfe4498e5bebf50f50bf (patch) | |
| tree | 858b433184bc615306e07c1d0ccaeb99ef5a6300 | |
| parent | ed06de52a53135ee42e528496fdddbf3d74b0479 (diff) | |
| download | emacs-68f8bc3111424527205ebfe4498e5bebf50f50bf.tar.gz emacs-68f8bc3111424527205ebfe4498e5bebf50f50bf.zip | |
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.
| -rw-r--r-- | src/fns.c | 3 | ||||
| -rw-r--r-- | src/lisp.h | 2 |
2 files changed, 3 insertions, 2 deletions
| @@ -4515,7 +4515,8 @@ hash_index_size (ptrdiff_t size) | |||
| 4515 | /* An upper bound on the size of a hash table index. It must fit in | 4515 | /* An upper bound on the size of a hash table index. It must fit in |
| 4516 | ptrdiff_t and be a valid Emacs fixnum. */ | 4516 | ptrdiff_t and be a valid Emacs fixnum. */ |
| 4517 | ptrdiff_t upper_bound = min (MOST_POSITIVE_FIXNUM, | 4517 | ptrdiff_t upper_bound = min (MOST_POSITIVE_FIXNUM, |
| 4518 | PTRDIFF_MAX / sizeof (ptrdiff_t)); | 4518 | min (TYPE_MAXIMUM (hash_idx_t), |
| 4519 | PTRDIFF_MAX / sizeof (ptrdiff_t))); | ||
| 4519 | ptrdiff_t index_size = size + (size >> 2); /* 1.25x larger */ | 4520 | ptrdiff_t index_size = size + (size >> 2); /* 1.25x larger */ |
| 4520 | if (index_size < upper_bound) | 4521 | if (index_size < upper_bound) |
| 4521 | index_size = next_almost_prime (index_size); | 4522 | index_size = next_almost_prime (index_size); |
diff --git a/src/lisp.h b/src/lisp.h index 5b70e96d6a1..f27f506b58f 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2432,7 +2432,7 @@ verify (FIXNUM_OVERFLOW_P (hash_unused)); | |||
| 2432 | 2432 | ||
| 2433 | /* The type of a hash table index, both for table indices and index | 2433 | /* The type of a hash table index, both for table indices and index |
| 2434 | (hash) indices. It's signed and a subtype of ptrdiff_t. */ | 2434 | (hash) indices. It's signed and a subtype of ptrdiff_t. */ |
| 2435 | typedef ptrdiff_t hash_idx_t; | 2435 | typedef int32_t hash_idx_t; |
| 2436 | 2436 | ||
| 2437 | struct Lisp_Hash_Table | 2437 | struct Lisp_Hash_Table |
| 2438 | { | 2438 | { |