aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
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 /src/lisp.h
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.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h23
1 files changed, 1 insertions, 22 deletions
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 *);