aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2017-02-21 15:31:29 -0800
committerPaul Eggert2017-02-21 15:39:17 -0800
commit7207b63c8e290ddec33908ce8d38be5793388318 (patch)
tree144d55c7556c9514b4e3690f56f3bae35ab736fc /src/lisp.h
parentf2191691d4e814d38369053cdec428ee2142ab18 (diff)
downloademacs-7207b63c8e290ddec33908ce8d38be5793388318.tar.gz
emacs-7207b63c8e290ddec33908ce8d38be5793388318.zip
Hash table threshold is now float, not double
Change default from 0.8 to 0.8125 so it fits in float without rounding glitches. * doc/lispref/hash.texi (Creating Hash): * doc/lispref/objects.texi (Hash Table Type): * etc/NEWS: Document change. * src/fns.c (make_hash_table, maybe_resize_hash_table) (Fmake_hash_table): Threshold is now float, not double. Be consistent about how this is rounded. * src/lisp.h (struct Lisp_Hash_Table.rehash_threshold): Change back to float, now that the other code rounds consistently. (DEFAULT_REHASH_THRESHOLD): Now float 0.8125 instead of double 0.8.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h
index be42b3354e2..6e0252621a6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2004,7 +2004,7 @@ struct Lisp_Hash_Table
2004 2004
2005 /* Resize hash table when number of entries / table size is >= this 2005 /* Resize hash table when number of entries / table size is >= this
2006 ratio. */ 2006 ratio. */
2007 double rehash_threshold; 2007 float rehash_threshold;
2008 2008
2009 /* Vector of keys and values. The key of item I is found at index 2009 /* Vector of keys and values. The key of item I is found at index
2010 2 * I, the value is found at index 2 * I + 1. 2010 2 * I, the value is found at index 2 * I + 1.
@@ -2088,7 +2088,7 @@ enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 };
2088 value gives the ratio of current entries in the hash table and the 2088 value gives the ratio of current entries in the hash table and the
2089 size of the hash table. */ 2089 size of the hash table. */
2090 2090
2091static double const DEFAULT_REHASH_THRESHOLD = 0.8; 2091static float const DEFAULT_REHASH_THRESHOLD = 0.8125;
2092 2092
2093/* Default factor by which to increase the size of a hash table. */ 2093/* Default factor by which to increase the size of a hash table. */
2094 2094
@@ -3363,7 +3363,7 @@ EMACS_UINT hash_string (char const *, ptrdiff_t);
3363EMACS_UINT sxhash (Lisp_Object, int); 3363EMACS_UINT sxhash (Lisp_Object, int);
3364Lisp_Object make_hash_table (struct hash_table_test test, 3364Lisp_Object make_hash_table (struct hash_table_test test,
3365 Lisp_Object size, Lisp_Object rehash_size, 3365 Lisp_Object size, Lisp_Object rehash_size,
3366 double rehash_threshold, Lisp_Object weak, 3366 float rehash_threshold, Lisp_Object weak,
3367 bool pure); 3367 bool pure);
3368ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *); 3368ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *);
3369ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, 3369ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,