aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-10-26 17:17:01 +0200
committerMattias EngdegÄrd2024-01-13 20:50:37 +0100
commitc3d0cc50faf588479db62e20ceabe044dd89e244 (patch)
tree32333d6369a1cddf1799a00ba46bd22d26d473af
parentc6bdc1ea1dc7f9a0b6d92d443f34c42affde73d1 (diff)
downloademacs-c3d0cc50faf588479db62e20ceabe044dd89e244.tar.gz
emacs-c3d0cc50faf588479db62e20ceabe044dd89e244.zip
Remove rehash-threshold and rehash-size struct members
These parameters have no visible semantics and are hardly ever used, so just use the default values for all hash tables. This saves memory, shrinks the external representation, and will improve performance. * src/fns.c (std_rehash_size, std_rehash_threshold): New. (hash_index_size): Use std_rehash_threshold. Remove table argument. All callers updated. (make_hash_table): Remove rehash_size and rehash_threshold args. All callers updated. (maybe_resize_hash_table) (Fhash_table_rehash_size, Fhash_table_rehash_threshold): Use std_rehash_size and std_rehash_threshold. (Fmake_hash_table): Ignore :rehash-size and :rehash-threshold args. * src/lisp.h (struct Lisp_Hash_Table): Remove rehash_size and rehash_threshold fields. (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE): Remove. * src/lread.c (hash_table_from_plist): Don't read rehash-size or rehash-threshold. (syms_of_lread): Remove unused symbols. * src/print.c (print_object): Don't print rehash-size or rehash-threshold. * src/pdumper.c (dump_hash_table): Don't dump removed fields.
-rw-r--r--src/category.c4
-rw-r--r--src/emacs-module.c4
-rw-r--r--src/fns.c101
-rw-r--r--src/frame.c3
-rw-r--r--src/image.c4
-rw-r--r--src/lisp.h23
-rw-r--r--src/lread.c20
-rw-r--r--src/pdumper.c2
-rw-r--r--src/pgtkterm.c4
-rw-r--r--src/print.c8
-rw-r--r--src/profiler.c2
-rw-r--r--src/xfaces.c3
-rw-r--r--src/xterm.c5
13 files changed, 43 insertions, 140 deletions
diff --git a/src/category.c b/src/category.c
index 67429e82571..583cdb3eebb 100644
--- a/src/category.c
+++ b/src/category.c
@@ -51,9 +51,7 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
51 if (NILP (XCHAR_TABLE (table)->extras[1])) 51 if (NILP (XCHAR_TABLE (table)->extras[1]))
52 set_char_table_extras 52 set_char_table_extras
53 (table, 1, 53 (table, 1,
54 make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, 54 make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false));
55 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
56 Weak_None, false));
57 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); 55 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
58 Lisp_Object hash; 56 Lisp_Object hash;
59 ptrdiff_t i = hash_lookup (h, category_set, &hash); 57 ptrdiff_t i = hash_lookup (h, category_set, &hash);
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 44c3efd1440..60aed68f2cd 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1697,9 +1697,7 @@ syms_of_module (void)
1697{ 1697{
1698 staticpro (&Vmodule_refs_hash); 1698 staticpro (&Vmodule_refs_hash);
1699 Vmodule_refs_hash 1699 Vmodule_refs_hash
1700 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, 1700 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
1701 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
1702 Weak_None, false);
1703 1701
1704 DEFSYM (Qmodule_load_failed, "module-load-failed"); 1702 DEFSYM (Qmodule_load_failed, "module-load-failed");
1705 Fput (Qmodule_load_failed, Qerror_conditions, 1703 Fput (Qmodule_load_failed, Qerror_conditions,
diff --git a/src/fns.c b/src/fns.c
index 5837795f838..efec74d4959 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4509,11 +4509,17 @@ allocate_hash_table (void)
4509 - header_size - GCALIGNMENT) \ 4509 - header_size - GCALIGNMENT) \
4510 / word_size))) 4510 / word_size)))
4511 4511
4512/* Default factor by which to increase the size of a hash table. */
4513static const double std_rehash_size = 1.5;
4514
4515/* Resize hash table when number of entries / table size is >= this
4516 ratio. */
4517static const double std_rehash_threshold = 0.8125;
4518
4512static ptrdiff_t 4519static ptrdiff_t
4513hash_index_size (struct Lisp_Hash_Table *h, ptrdiff_t size) 4520hash_index_size (ptrdiff_t size)
4514{ 4521{
4515 double threshold = h->rehash_threshold; 4522 double index_float = size * (1.0 / std_rehash_threshold);
4516 double index_float = size / threshold;
4517 ptrdiff_t index_size = (index_float < INDEX_SIZE_BOUND + 1 4523 ptrdiff_t index_size = (index_float < INDEX_SIZE_BOUND + 1
4518 ? next_almost_prime (index_float) 4524 ? next_almost_prime (index_float)
4519 : INDEX_SIZE_BOUND + 1); 4525 : INDEX_SIZE_BOUND + 1);
@@ -4531,16 +4537,6 @@ hash_index_size (struct Lisp_Hash_Table *h, ptrdiff_t size)
4531 4537
4532 Give the table initial capacity SIZE, 0 <= SIZE <= MOST_POSITIVE_FIXNUM. 4538 Give the table initial capacity SIZE, 0 <= SIZE <= MOST_POSITIVE_FIXNUM.
4533 4539
4534 If REHASH_SIZE is equal to a negative integer, this hash table's
4535 new size when it becomes full is computed by subtracting
4536 REHASH_SIZE from its old size. Otherwise it must be positive, and
4537 the table's new size is computed by multiplying its old size by
4538 REHASH_SIZE + 1.
4539
4540 REHASH_THRESHOLD must be a float <= 1.0, and > 0. The table will
4541 be resized when the approximate ratio of table entries to table
4542 size exceeds REHASH_THRESHOLD.
4543
4544 WEAK specifies the weakness of the table. 4540 WEAK specifies the weakness of the table.
4545 4541
4546 If PURECOPY is non-nil, the table can be copied to pure storage via 4542 If PURECOPY is non-nil, the table can be copied to pure storage via
@@ -4549,7 +4545,6 @@ hash_index_size (struct Lisp_Hash_Table *h, ptrdiff_t size)
4549 4545
4550Lisp_Object 4546Lisp_Object
4551make_hash_table (struct hash_table_test test, EMACS_INT size, 4547make_hash_table (struct hash_table_test test, EMACS_INT size,
4552 float rehash_size, float rehash_threshold,
4553 hash_table_weakness_t weak, bool purecopy) 4548 hash_table_weakness_t weak, bool purecopy)
4554{ 4549{
4555 struct Lisp_Hash_Table *h; 4550 struct Lisp_Hash_Table *h;
@@ -4559,8 +4554,6 @@ make_hash_table (struct hash_table_test test, EMACS_INT size,
4559 /* Preconditions. */ 4554 /* Preconditions. */
4560 eassert (SYMBOLP (test.name)); 4555 eassert (SYMBOLP (test.name));
4561 eassert (0 <= size && size <= MOST_POSITIVE_FIXNUM); 4556 eassert (0 <= size && size <= MOST_POSITIVE_FIXNUM);
4562 eassert (rehash_size <= -1 || 0 < rehash_size);
4563 eassert (0 < rehash_threshold && rehash_threshold <= 1);
4564 4557
4565 if (size == 0) 4558 if (size == 0)
4566 size = 1; 4559 size = 1;
@@ -4571,13 +4564,11 @@ make_hash_table (struct hash_table_test test, EMACS_INT size,
4571 /* Initialize hash table slots. */ 4564 /* Initialize hash table slots. */
4572 h->test = test; 4565 h->test = test;
4573 h->weakness = weak; 4566 h->weakness = weak;
4574 h->rehash_threshold = rehash_threshold;
4575 h->rehash_size = rehash_size;
4576 h->count = 0; 4567 h->count = 0;
4577 h->key_and_value = make_vector (2 * size, HASH_UNUSED_ENTRY_KEY); 4568 h->key_and_value = make_vector (2 * size, HASH_UNUSED_ENTRY_KEY);
4578 h->hash = make_nil_vector (size); 4569 h->hash = make_nil_vector (size);
4579 h->next = make_vector (size, make_fixnum (-1)); 4570 h->next = make_vector (size, make_fixnum (-1));
4580 h->index = make_vector (hash_index_size (h, size), make_fixnum (-1)); 4571 h->index = make_vector (hash_index_size (size), make_fixnum (-1));
4581 h->next_weak = NULL; 4572 h->next_weak = NULL;
4582 h->purecopy = purecopy; 4573 h->purecopy = purecopy;
4583 h->mutable = true; 4574 h->mutable = true;
@@ -4648,18 +4639,12 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
4648 { 4639 {
4649 ptrdiff_t old_size = HASH_TABLE_SIZE (h); 4640 ptrdiff_t old_size = HASH_TABLE_SIZE (h);
4650 EMACS_INT new_size; 4641 EMACS_INT new_size;
4651 double rehash_size = h->rehash_size;
4652 4642
4653 if (rehash_size < 0) 4643 double float_new_size = old_size * std_rehash_size;
4654 new_size = old_size - rehash_size; 4644 if (float_new_size < EMACS_INT_MAX)
4645 new_size = float_new_size;
4655 else 4646 else
4656 { 4647 new_size = EMACS_INT_MAX;
4657 double float_new_size = old_size * (rehash_size + 1);
4658 if (float_new_size < EMACS_INT_MAX)
4659 new_size = float_new_size;
4660 else
4661 new_size = EMACS_INT_MAX;
4662 }
4663 if (PTRDIFF_MAX < new_size) 4648 if (PTRDIFF_MAX < new_size)
4664 new_size = PTRDIFF_MAX; 4649 new_size = PTRDIFF_MAX;
4665 if (new_size <= old_size) 4650 if (new_size <= old_size)
@@ -4682,7 +4667,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
4682 Lisp_Object hash = alloc_larger_vector (h->hash, new_size); 4667 Lisp_Object hash = alloc_larger_vector (h->hash, new_size);
4683 memclear (XVECTOR (hash)->contents + old_size, 4668 memclear (XVECTOR (hash)->contents + old_size,
4684 (new_size - old_size) * word_size); 4669 (new_size - old_size) * word_size);
4685 ptrdiff_t index_size = hash_index_size (h, new_size); 4670 ptrdiff_t index_size = hash_index_size (new_size);
4686 h->index = make_vector (index_size, make_fixnum (-1)); 4671 h->index = make_vector (index_size, make_fixnum (-1));
4687 h->key_and_value = key_and_value; 4672 h->key_and_value = key_and_value;
4688 h->hash = hash; 4673 h->hash = hash;
@@ -5281,15 +5266,6 @@ keys. Default is `eql'. Predefined are the tests `eq', `eql', and
5281:size SIZE -- A hint as to how many elements will be put in the table. 5266:size SIZE -- A hint as to how many elements will be put in the table.
5282Default is 65. 5267Default is 65.
5283 5268
5284:rehash-size REHASH-SIZE - Indicates how to expand the table when it
5285fills up. If REHASH-SIZE is an integer, increase the size by that
5286amount. If it is a float, it must be > 1.0, and the new size is the
5287old size multiplied by that factor. Default is 1.5.
5288
5289:rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0.
5290Resize the hash table when the ratio (table entries / table size)
5291exceeds an approximation to THRESHOLD. Default is 0.8125.
5292
5293:weakness WEAK -- WEAK must be one of nil, t, `key', `value', 5269:weakness WEAK -- WEAK must be one of nil, t, `key', `value',
5294`key-or-value', or `key-and-value'. If WEAK is not nil, the table 5270`key-or-value', or `key-and-value'. If WEAK is not nil, the table
5295returned is a weak table. Key/value pairs are removed from a weak 5271returned is a weak table. Key/value pairs are removed from a weak
@@ -5303,6 +5279,9 @@ to pure storage when Emacs is being dumped, making the contents of the
5303table read only. Any further changes to purified tables will result 5279table read only. Any further changes to purified tables will result
5304in an error. 5280in an error.
5305 5281
5282The keywords arguments :rehash-threshold and :rehash-size are obsolete
5283and ignored.
5284
5306usage: (make-hash-table &rest KEYWORD-ARGS) */) 5285usage: (make-hash-table &rest KEYWORD-ARGS) */)
5307 (ptrdiff_t nargs, Lisp_Object *args) 5286 (ptrdiff_t nargs, Lisp_Object *args)
5308{ 5287{
@@ -5352,26 +5331,6 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
5352 else 5331 else
5353 signal_error ("Invalid hash table size", size_arg); 5332 signal_error ("Invalid hash table size", size_arg);
5354 5333
5355 /* Look for `:rehash-size SIZE'. */
5356 float rehash_size;
5357 i = get_key_arg (QCrehash_size, nargs, args, used);
5358 if (!i)
5359 rehash_size = DEFAULT_REHASH_SIZE;
5360 else if (FIXNUMP (args[i]) && 0 < XFIXNUM (args[i]))
5361 rehash_size = - XFIXNUM (args[i]);
5362 else if (FLOATP (args[i]) && 0 < (float) (XFLOAT_DATA (args[i]) - 1))
5363 rehash_size = (float) (XFLOAT_DATA (args[i]) - 1);
5364 else
5365 signal_error ("Invalid hash table rehash size", args[i]);
5366
5367 /* Look for `:rehash-threshold THRESHOLD'. */
5368 i = get_key_arg (QCrehash_threshold, nargs, args, used);
5369 float rehash_threshold = (!i ? DEFAULT_REHASH_THRESHOLD
5370 : !FLOATP (args[i]) ? 0
5371 : (float) XFLOAT_DATA (args[i]));
5372 if (! (0 < rehash_threshold && rehash_threshold <= 1))
5373 signal_error ("Invalid hash table rehash threshold", args[i]);
5374
5375 /* Look for `:weakness WEAK'. */ 5334 /* Look for `:weakness WEAK'. */
5376 i = get_key_arg (QCweakness, nargs, args, used); 5335 i = get_key_arg (QCweakness, nargs, args, used);
5377 Lisp_Object weakness = i ? args[i] : Qnil; 5336 Lisp_Object weakness = i ? args[i] : Qnil;
@@ -5392,11 +5351,16 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
5392 /* Now, all args should have been used up, or there's a problem. */ 5351 /* Now, all args should have been used up, or there's a problem. */
5393 for (i = 0; i < nargs; ++i) 5352 for (i = 0; i < nargs; ++i)
5394 if (!used[i]) 5353 if (!used[i])
5395 signal_error ("Invalid argument list", args[i]); 5354 {
5355 /* Ignore obsolete arguments. */
5356 if (EQ (args[i], QCrehash_threshold) || EQ (args[i], QCrehash_size))
5357 i++;
5358 else
5359 signal_error ("Invalid argument list", args[i]);
5360 }
5396 5361
5397 SAFE_FREE (); 5362 SAFE_FREE ();
5398 return make_hash_table (testdesc, size, rehash_size, rehash_threshold, weak, 5363 return make_hash_table (testdesc, size, weak, purecopy);
5399 purecopy);
5400} 5364}
5401 5365
5402 5366
@@ -5422,14 +5386,8 @@ DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size,
5422 doc: /* Return the current rehash size of TABLE. */) 5386 doc: /* Return the current rehash size of TABLE. */)
5423 (Lisp_Object table) 5387 (Lisp_Object table)
5424{ 5388{
5425 double rehash_size = check_hash_table (table)->rehash_size; 5389 CHECK_HASH_TABLE (table);
5426 if (rehash_size < 0) 5390 return make_float (std_rehash_size);
5427 {
5428 EMACS_INT s = -rehash_size;
5429 return make_fixnum (min (s, MOST_POSITIVE_FIXNUM));
5430 }
5431 else
5432 return make_float (rehash_size + 1);
5433} 5391}
5434 5392
5435 5393
@@ -5438,7 +5396,8 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold,
5438 doc: /* Return the current rehash threshold of TABLE. */) 5396 doc: /* Return the current rehash threshold of TABLE. */)
5439 (Lisp_Object table) 5397 (Lisp_Object table)
5440{ 5398{
5441 return make_float (check_hash_table (table)->rehash_threshold); 5399 CHECK_HASH_TABLE (table);
5400 return make_float (std_rehash_threshold);
5442} 5401}
5443 5402
5444 5403
diff --git a/src/frame.c b/src/frame.c
index 41b0f2f5764..08057736272 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1040,8 +1040,7 @@ make_frame (bool mini_p)
1040 rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f); 1040 rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f);
1041 1041
1042 fset_face_hash_table 1042 fset_face_hash_table
1043 (f, make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, 1043 (f, make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false));
1044 DEFAULT_REHASH_THRESHOLD, Weak_None, false));
1045 1044
1046 if (mini_p) 1045 if (mini_p)
1047 { 1046 {
diff --git a/src/image.c b/src/image.c
index 92e1e0b0be7..9c100213590 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6069,9 +6069,7 @@ xpm_make_color_table_h (void (**put_func) (Lisp_Object, const char *, int,
6069{ 6069{
6070 *put_func = xpm_put_color_table_h; 6070 *put_func = xpm_put_color_table_h;
6071 *get_func = xpm_get_color_table_h; 6071 *get_func = xpm_get_color_table_h;
6072 return make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, 6072 return make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false);
6073 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
6074 Weak_None, false);
6075} 6073}
6076 6074
6077static void 6075static void
diff --git a/src/lisp.h b/src/lisp.h
index 480d963e63d..48e1f943ed8 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2482,17 +2482,6 @@ struct Lisp_Hash_Table
2482 immutable for recursive attempts to mutate it. */ 2482 immutable for recursive attempts to mutate it. */
2483 bool mutable; 2483 bool mutable;
2484 2484
2485 /* Resize hash table when number of entries / table size is >= this
2486 ratio. */
2487 float rehash_threshold;
2488
2489 /* Used when the table is resized. If equal to a negative integer,
2490 the user rehash-size is the integer -REHASH_SIZE, and the new
2491 size is the old size plus -REHASH_SIZE. If positive, the user
2492 rehash-size is the floating-point value REHASH_SIZE + 1, and the
2493 new size is the old size times REHASH_SIZE + 1. */
2494 float rehash_size;
2495
2496 /* Vector of keys and values. The key of item I is found at index 2485 /* Vector of keys and values. The key of item I is found at index
2497 2 * I, the value is found at index 2 * I + 1. 2486 2 * I, the value is found at index 2 * I + 1.
2498 If the key is HASH_UNUSED_ENTRY_KEY, then this slot is unused. 2487 If the key is HASH_UNUSED_ENTRY_KEY, then this slot is unused.
@@ -2580,16 +2569,6 @@ void hash_table_rehash (Lisp_Object);
2580 2569
2581enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 }; 2570enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 };
2582 2571
2583/* Default threshold specifying when to resize a hash table. The
2584 value gives the ratio of current entries in the hash table and the
2585 size of the hash table. */
2586
2587static float const DEFAULT_REHASH_THRESHOLD = 0.8125;
2588
2589/* Default factor by which to increase the size of a hash table, minus 1. */
2590
2591static float const DEFAULT_REHASH_SIZE = 1.5 - 1;
2592
2593/* Combine two integers X and Y for hashing. The result might exceed 2572/* Combine two integers X and Y for hashing. The result might exceed
2594 INTMASK. */ 2573 INTMASK. */
2595 2574
@@ -4060,7 +4039,7 @@ extern char *extract_data_from_object (Lisp_Object, ptrdiff_t *, ptrdiff_t *);
4060EMACS_UINT hash_string (char const *, ptrdiff_t); 4039EMACS_UINT hash_string (char const *, ptrdiff_t);
4061EMACS_UINT sxhash (Lisp_Object); 4040EMACS_UINT sxhash (Lisp_Object);
4062Lisp_Object hashfn_user_defined (Lisp_Object, struct Lisp_Hash_Table *); 4041Lisp_Object hashfn_user_defined (Lisp_Object, struct Lisp_Hash_Table *);
4063Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT, float, float, 4042Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT,
4064 hash_table_weakness_t, bool); 4043 hash_table_weakness_t, bool);
4065Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak); 4044Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
4066ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object *); 4045ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object *);
diff --git a/src/lread.c b/src/lread.c
index 6d3c06265e0..284536fc81f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2544,15 +2544,11 @@ readevalloop (Lisp_Object readcharfun,
2544 if (! HASH_TABLE_P (read_objects_map) 2544 if (! HASH_TABLE_P (read_objects_map)
2545 || XHASH_TABLE (read_objects_map)->count) 2545 || XHASH_TABLE (read_objects_map)->count)
2546 read_objects_map 2546 read_objects_map
2547 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, 2547 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
2548 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
2549 Weak_None, false);
2550 if (! HASH_TABLE_P (read_objects_completed) 2548 if (! HASH_TABLE_P (read_objects_completed)
2551 || XHASH_TABLE (read_objects_completed)->count) 2549 || XHASH_TABLE (read_objects_completed)->count)
2552 read_objects_completed 2550 read_objects_completed
2553 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, 2551 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
2554 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
2555 Weak_None, false);
2556 if (!NILP (Vpurify_flag) && c == '(') 2552 if (!NILP (Vpurify_flag) && c == '(')
2557 val = read0 (readcharfun, false); 2553 val = read0 (readcharfun, false);
2558 else 2554 else
@@ -2796,13 +2792,11 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end,
2796 if (! HASH_TABLE_P (read_objects_map) 2792 if (! HASH_TABLE_P (read_objects_map)
2797 || XHASH_TABLE (read_objects_map)->count) 2793 || XHASH_TABLE (read_objects_map)->count)
2798 read_objects_map 2794 read_objects_map
2799 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, 2795 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
2800 DEFAULT_REHASH_THRESHOLD, Weak_None, false);
2801 if (! HASH_TABLE_P (read_objects_completed) 2796 if (! HASH_TABLE_P (read_objects_completed)
2802 || XHASH_TABLE (read_objects_completed)->count) 2797 || XHASH_TABLE (read_objects_completed)->count)
2803 read_objects_completed 2798 read_objects_completed
2804 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, 2799 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
2805 DEFAULT_REHASH_THRESHOLD, Weak_None, false);
2806 2800
2807 if (STRINGP (stream) 2801 if (STRINGP (stream)
2808 || ((CONSP (stream) && STRINGP (XCAR (stream))))) 2802 || ((CONSP (stream) && STRINGP (XCAR (stream)))))
@@ -3412,7 +3406,7 @@ read_string_literal (Lisp_Object readcharfun)
3412static Lisp_Object 3406static Lisp_Object
3413hash_table_from_plist (Lisp_Object plist) 3407hash_table_from_plist (Lisp_Object plist)
3414{ 3408{
3415 Lisp_Object params[12]; 3409 Lisp_Object params[4 * 2];
3416 Lisp_Object *par = params; 3410 Lisp_Object *par = params;
3417 3411
3418 /* This is repetitive but fast and simple. */ 3412 /* This is repetitive but fast and simple. */
@@ -3428,8 +3422,6 @@ hash_table_from_plist (Lisp_Object plist)
3428 3422
3429 ADDPARAM (test); 3423 ADDPARAM (test);
3430 ADDPARAM (weakness); 3424 ADDPARAM (weakness);
3431 ADDPARAM (rehash_size);
3432 ADDPARAM (rehash_threshold);
3433 ADDPARAM (purecopy); 3425 ADDPARAM (purecopy);
3434 3426
3435 Lisp_Object data = plist_get (plist, Qdata); 3427 Lisp_Object data = plist_get (plist, Qdata);
@@ -5998,8 +5990,6 @@ that are loaded before your customizations are read! */);
5998 DEFSYM (Qsize, "size"); 5990 DEFSYM (Qsize, "size");
5999 DEFSYM (Qpurecopy, "purecopy"); 5991 DEFSYM (Qpurecopy, "purecopy");
6000 DEFSYM (Qweakness, "weakness"); 5992 DEFSYM (Qweakness, "weakness");
6001 DEFSYM (Qrehash_size, "rehash-size");
6002 DEFSYM (Qrehash_threshold, "rehash-threshold");
6003 5993
6004 DEFSYM (Qchar_from_name, "char-from-name"); 5994 DEFSYM (Qchar_from_name, "char-from-name");
6005 5995
diff --git a/src/pdumper.c b/src/pdumper.c
index 982b991dc63..8072148c542 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2729,8 +2729,6 @@ dump_hash_table (struct dump_context *ctx, Lisp_Object object)
2729 DUMP_FIELD_COPY (out, hash, weakness); 2729 DUMP_FIELD_COPY (out, hash, weakness);
2730 DUMP_FIELD_COPY (out, hash, purecopy); 2730 DUMP_FIELD_COPY (out, hash, purecopy);
2731 DUMP_FIELD_COPY (out, hash, mutable); 2731 DUMP_FIELD_COPY (out, hash, mutable);
2732 DUMP_FIELD_COPY (out, hash, rehash_threshold);
2733 DUMP_FIELD_COPY (out, hash, rehash_size);
2734 dump_field_lv (ctx, out, hash, &hash->key_and_value, WEIGHT_STRONG); 2732 dump_field_lv (ctx, out, hash, &hash->key_and_value, WEIGHT_STRONG);
2735 dump_field_lv (ctx, out, hash, &hash->test.name, WEIGHT_STRONG); 2733 dump_field_lv (ctx, out, hash, &hash->test.name, WEIGHT_STRONG);
2736 dump_field_lv (ctx, out, hash, &hash->test.user_hash_function, 2734 dump_field_lv (ctx, out, hash, &hash->test.user_hash_function,
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index b45cf56135d..57ea82daa5e 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -7178,9 +7178,7 @@ If set to a non-float value, there will be no wait at all. */);
7178 7178
7179 DEFVAR_LISP ("pgtk-keysym-table", Vpgtk_keysym_table, 7179 DEFVAR_LISP ("pgtk-keysym-table", Vpgtk_keysym_table,
7180 doc: /* Hash table of character codes indexed by X keysym codes. */); 7180 doc: /* Hash table of character codes indexed by X keysym codes. */);
7181 Vpgtk_keysym_table = make_hash_table (hashtest_eql, 900, DEFAULT_REHASH_SIZE, 7181 Vpgtk_keysym_table = make_hash_table (hashtest_eql, 900, Weak_None, false);
7182 DEFAULT_REHASH_THRESHOLD,
7183 Weak_None, false);
7184 7182
7185 window_being_scrolled = Qnil; 7183 window_being_scrolled = Qnil;
7186 staticpro (&window_being_scrolled); 7184 staticpro (&window_being_scrolled);
diff --git a/src/print.c b/src/print.c
index 9c361444458..cc8df639f4f 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2590,14 +2590,6 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
2590 printcharfun, escapeflag); 2590 printcharfun, escapeflag);
2591 } 2591 }
2592 2592
2593 print_c_string (" rehash-size ", printcharfun);
2594 print_object (Fhash_table_rehash_size (obj),
2595 printcharfun, escapeflag);
2596
2597 print_c_string (" rehash-threshold ", printcharfun);
2598 print_object (Fhash_table_rehash_threshold (obj),
2599 printcharfun, escapeflag);
2600
2601 if (h->purecopy) 2593 if (h->purecopy)
2602 print_c_string (" purecopy t", printcharfun); 2594 print_c_string (" purecopy t", printcharfun);
2603 2595
diff --git a/src/profiler.c b/src/profiler.c
index a75998c7c40..06ffecf41e3 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -564,8 +564,6 @@ export_log (struct profiler_log *plog)
564 the log but close enough, and will never confuse two distinct 564 the log but close enough, and will never confuse two distinct
565 keys in the log. */ 565 keys in the log. */
566 Lisp_Object h = make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, 566 Lisp_Object h = make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE,
567 DEFAULT_REHASH_SIZE,
568 DEFAULT_REHASH_THRESHOLD,
569 Weak_None, false); 567 Weak_None, false);
570 for (int i = 0; i < log->size; i++) 568 for (int i = 0; i < log->size; i++)
571 { 569 {
diff --git a/src/xfaces.c b/src/xfaces.c
index 7c3dd7ebc15..c9dd0f90feb 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7333,8 +7333,7 @@ only for this purpose. */);
7333 doc: /* Hash table of global face definitions (for internal use only.) */); 7333 doc: /* Hash table of global face definitions (for internal use only.) */);
7334 Vface_new_frame_defaults = 7334 Vface_new_frame_defaults =
7335 /* 33 entries is enough to fit all basic faces */ 7335 /* 33 entries is enough to fit all basic faces */
7336 make_hash_table (hashtest_eq, 33, DEFAULT_REHASH_SIZE, 7336 make_hash_table (hashtest_eq, 33, Weak_None, false);
7337 DEFAULT_REHASH_THRESHOLD, Weak_None, false);
7338 7337
7339 DEFVAR_LISP ("face-default-stipple", Vface_default_stipple, 7338 DEFVAR_LISP ("face-default-stipple", Vface_default_stipple,
7340 doc: /* Default stipple pattern used on monochrome displays. 7339 doc: /* Default stipple pattern used on monochrome displays.
diff --git a/src/xterm.c b/src/xterm.c
index 98f8c8afb3b..e4139a79a6e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -32554,10 +32554,7 @@ If set to a non-float value, there will be no wait at all. */);
32554 32554
32555 DEFVAR_LISP ("x-keysym-table", Vx_keysym_table, 32555 DEFVAR_LISP ("x-keysym-table", Vx_keysym_table,
32556 doc: /* Hash table of character codes indexed by X keysym codes. */); 32556 doc: /* Hash table of character codes indexed by X keysym codes. */);
32557 Vx_keysym_table = make_hash_table (hashtest_eql, 900, 32557 Vx_keysym_table = make_hash_table (hashtest_eql, 900, Weak_None, false);
32558 DEFAULT_REHASH_SIZE,
32559 DEFAULT_REHASH_THRESHOLD,
32560 Weak_None, false);
32561 32558
32562 DEFVAR_BOOL ("x-frame-normalize-before-maximize", 32559 DEFVAR_BOOL ("x-frame-normalize-before-maximize",
32563 x_frame_normalize_before_maximize, 32560 x_frame_normalize_before_maximize,