diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/category.c | 4 | ||||
| -rw-r--r-- | src/emacs-module.c | 4 | ||||
| -rw-r--r-- | src/fns.c | 101 | ||||
| -rw-r--r-- | src/frame.c | 3 | ||||
| -rw-r--r-- | src/image.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 23 | ||||
| -rw-r--r-- | src/lread.c | 20 | ||||
| -rw-r--r-- | src/pdumper.c | 2 | ||||
| -rw-r--r-- | src/pgtkterm.c | 4 | ||||
| -rw-r--r-- | src/print.c | 8 | ||||
| -rw-r--r-- | src/profiler.c | 2 | ||||
| -rw-r--r-- | src/xfaces.c | 3 | ||||
| -rw-r--r-- | src/xterm.c | 5 |
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, |
| @@ -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. */ | ||
| 4513 | static const double std_rehash_size = 1.5; | ||
| 4514 | |||
| 4515 | /* Resize hash table when number of entries / table size is >= this | ||
| 4516 | ratio. */ | ||
| 4517 | static const double std_rehash_threshold = 0.8125; | ||
| 4518 | |||
| 4512 | static ptrdiff_t | 4519 | static ptrdiff_t |
| 4513 | hash_index_size (struct Lisp_Hash_Table *h, ptrdiff_t size) | 4520 | hash_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 | ||
| 4550 | Lisp_Object | 4546 | Lisp_Object |
| 4551 | make_hash_table (struct hash_table_test test, EMACS_INT size, | 4547 | make_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. |
| 5282 | Default is 65. | 5267 | Default is 65. |
| 5283 | 5268 | ||
| 5284 | :rehash-size REHASH-SIZE - Indicates how to expand the table when it | ||
| 5285 | fills up. If REHASH-SIZE is an integer, increase the size by that | ||
| 5286 | amount. If it is a float, it must be > 1.0, and the new size is the | ||
| 5287 | old size multiplied by that factor. Default is 1.5. | ||
| 5288 | |||
| 5289 | :rehash-threshold THRESHOLD -- THRESHOLD must a float > 0, and <= 1.0. | ||
| 5290 | Resize the hash table when the ratio (table entries / table size) | ||
| 5291 | exceeds 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 |
| 5295 | returned is a weak table. Key/value pairs are removed from a weak | 5271 | returned 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 | |||
| 5303 | table read only. Any further changes to purified tables will result | 5279 | table read only. Any further changes to purified tables will result |
| 5304 | in an error. | 5280 | in an error. |
| 5305 | 5281 | ||
| 5282 | The keywords arguments :rehash-threshold and :rehash-size are obsolete | ||
| 5283 | and ignored. | ||
| 5284 | |||
| 5306 | usage: (make-hash-table &rest KEYWORD-ARGS) */) | 5285 | usage: (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 | ||
| 6077 | static void | 6075 | static 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 | ||
| 2581 | enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 }; | 2570 | enum 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 | |||
| 2587 | static float const DEFAULT_REHASH_THRESHOLD = 0.8125; | ||
| 2588 | |||
| 2589 | /* Default factor by which to increase the size of a hash table, minus 1. */ | ||
| 2590 | |||
| 2591 | static 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 *); | |||
| 4060 | EMACS_UINT hash_string (char const *, ptrdiff_t); | 4039 | EMACS_UINT hash_string (char const *, ptrdiff_t); |
| 4061 | EMACS_UINT sxhash (Lisp_Object); | 4040 | EMACS_UINT sxhash (Lisp_Object); |
| 4062 | Lisp_Object hashfn_user_defined (Lisp_Object, struct Lisp_Hash_Table *); | 4041 | Lisp_Object hashfn_user_defined (Lisp_Object, struct Lisp_Hash_Table *); |
| 4063 | Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT, float, float, | 4042 | Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT, |
| 4064 | hash_table_weakness_t, bool); | 4043 | hash_table_weakness_t, bool); |
| 4065 | Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak); | 4044 | Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak); |
| 4066 | ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object *); | 4045 | ptrdiff_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) | |||
| 3412 | static Lisp_Object | 3406 | static Lisp_Object |
| 3413 | hash_table_from_plist (Lisp_Object plist) | 3407 | hash_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, |