From b45eaf2fe16fb0e94333ab848962892b48648a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 13 Dec 2021 21:17:58 +0100 Subject: 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. --- Hashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.3