summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-12-13 21:17:58 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-12-13 21:17:58 +0100
commitb45eaf2fe16fb0e94333ab848962892b48648a28 (patch)
tree79f799c0157c14382fe401a711cdc69d1d24f46b
parent230dc9c3c1219ebb49b90bff99d14a338453f6e3 (diff)
Hashtable: use a minimum size of 7
With a size of 2 or 3 the grow factor does not reach 70% for one empty entry. This will cause the following assert violation: htop: Hashtable.c:236: void Hashtable_put(Hashtable *, ht_key_t, void *): Assertion `this->size > this->items' failed.
-rw-r--r--Hashtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Hashtable.c b/Hashtable.c
index 8aff1df3..a0cfc9e0 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -90,7 +90,7 @@ size_t Hashtable_count(const Hashtable* this) {
/* https://oeis.org/A014234 */
static const uint64_t OEISprimes[] = {
- 2, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191,
+ 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191,
16381, 32749, 65521, 131071, 262139, 524287, 1048573,
2097143, 4194301, 8388593, 16777213, 33554393,
67108859, 134217689, 268435399, 536870909, 1073741789,

© 2014-2024 Faster IT GmbH | imprint | privacy policy