diff options
author | Eric Haszlakiewicz <erh+git@nimenees.com> | 2012-03-31 17:33:58 -0500 |
---|---|---|
committer | Eric Haszlakiewicz <erh+git@nimenees.com> | 2012-03-31 17:33:58 -0500 |
commit | 64c0ca3690f98e978fd2fc8c6ca645243c27e3db (patch) | |
tree | 17ea82874c4705ad3900c4f23b35df1691139f19 /linkhash.h | |
parent | aef439a1750a69c4721df50b83d696218a60db49 (diff) |
Define a LH_LOAD_FACTOR constant and note the range that it can be set to.
Change the resize check from "count > size" to "count >= size" to avoid a
potential infinite loop with high load factors and a full hash table.
Diffstat (limited to 'linkhash.h')
-rw-r--r-- | linkhash.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -22,6 +22,13 @@ extern "C" { #define LH_PRIME 0x9e370001UL /** + * The fraction of filled hash buckets until an insert will cause the table + * to be resized. + * This can range from just above 0 up to 1.0. + */ +#define LH_LOAD_FACTOR 0.66 + +/** * sentinel pointer value for empty slots */ #define LH_EMPTY (void*)-1 |