X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhtable%2Ftools%2Fspeed.c;h=26231924a1f68b33cfe244b21981d0cb4ca5ebe2;hp=d5a3f6520fb2267f61c4a80c2faef27604a8ef5d;hb=b30c544bd1486e7b60b99259e3d0dcbc1ec9efd0;hpb=ee0e05e46813b239453e9f52b924d4d9df4607df diff --git a/ccan/htable/tools/speed.c b/ccan/htable/tools/speed.c index d5a3f652..26231924 100644 --- a/ccan/htable/tools/speed.c +++ b/ccan/htable/tools/speed.c @@ -73,8 +73,11 @@ static size_t perfect(const struct htable *ht) if (!entry_is_valid(ht->table[i])) continue; if (hash_bucket(ht, ht->rehash(get_raw_ptr(ht, ht->table[i]), - ht->priv)) == i) + ht->priv)) == i) { + assert((ht->table[i] & ht->perfect_bit) + == ht->perfect_bit); placed_perfect++; + } } return placed_perfect; } @@ -327,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(); }