summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 027fd07d720..e048011a860 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1969,11 +1969,6 @@ struct Lisp_Hash_Table
weakness of the table. */
Lisp_Object weak;
- /* When the table is resized, and this is an integer, compute the
- new size by adding this to the old size. If a float, compute the
- new size by multiplying the old size with this factor. */
- Lisp_Object rehash_size;
-
/* Vector of hash codes. If hash[I] is nil, this means that the
I-th entry is unused. */
Lisp_Object hash;
@@ -2008,6 +2003,13 @@ struct Lisp_Hash_Table
ratio. */
float rehash_threshold;
+ /* Used when the table is resized. If equal to a negative integer,
+ the user rehash-size is the integer -REHASH_SIZE, and the new
+ size is the old size plus -REHASH_SIZE. If positive, the user
+ rehash-size is the floating-point value REHASH_SIZE + 1, and the
+ new size is the old size times REHASH_SIZE + 1. */
+ float rehash_size;
+
/* Vector of keys and values. The key of item I is found at index
2 * I, the value is found at index 2 * I + 1.
This is gc_marked specially if the table is weak. */
@@ -2076,9 +2078,9 @@ enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 };
static float const DEFAULT_REHASH_THRESHOLD = 0.8125;
-/* Default factor by which to increase the size of a hash table. */
+/* Default factor by which to increase the size of a hash table, minus 1. */
-static double const DEFAULT_REHASH_SIZE = 1.5;
+static float const DEFAULT_REHASH_SIZE = 1.5 - 1;
/* Combine two integers X and Y for hashing. The result might not fit
into a Lisp integer. */
@@ -3347,10 +3349,8 @@ extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t);
extern void sweep_weak_hash_tables (void);
EMACS_UINT hash_string (char const *, ptrdiff_t);
EMACS_UINT sxhash (Lisp_Object, int);
-Lisp_Object make_hash_table (struct hash_table_test test,
- Lisp_Object size, Lisp_Object rehash_size,
- float rehash_threshold, Lisp_Object weak,
- bool pure);
+Lisp_Object make_hash_table (struct hash_table_test, EMACS_INT, float, float,
+ Lisp_Object, bool);
ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *);
ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
EMACS_UINT);