diff options
-rw-r--r-- | ccan/htable/htable.c | 4 | ||||
-rw-r--r-- | ccan/htable/tools/speed.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ccan/htable/htable.c b/ccan/htable/htable.c index bbd4fa96..788e7189 100644 --- a/ccan/htable/htable.c +++ b/ccan/htable/htable.c @@ -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; diff --git a/ccan/htable/tools/speed.c b/ccan/htable/tools/speed.c index 72a08e6b..26231924 100644 --- a/ccan/htable/tools/speed.c +++ b/ccan/htable/tools/speed.c @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) fflush(stdout); gettimeofday(&start, NULL); for (i = 0; i < num; i++) { - unsigned int n = num * 6 + i * 9; + unsigned int n = num * (5 + 9) + i * 9; if (htable_obj_get(ht, &n)) abort(); } |