]> git.ozlabs.org Git - ccan/blobdiff - ccan/htable/htable.c
htable: push capacity limit from 66 to 75%
[ccan] / ccan / htable / htable.c
index bbd4fa96e587c64a04446756787bd163ad4dc3c8..788e71895b183db45768fd0327572dcf5ccf4fd5 100644 (file)
@@ -66,8 +66,8 @@ struct htable *htable_new(size_t (*rehash)(const void *elem, void *priv),
                ht->priv = priv;
                ht->elems = 0;
                ht->deleted = 0;
-               ht->max = (1 << ht->bits) * 2 / 3;
-               ht->max_with_deleted = (1 << ht->bits) * 4 / 5;
+               ht->max = ((size_t)1 << ht->bits) * 3 / 4;
+               ht->max_with_deleted = ((size_t)1 << ht->bits) * 9 / 10;
                /* This guarantees we enter update_common first add. */
                ht->common_mask = -1;
                ht->common_bits = 0;