(BVT (clib_bihash) * h, BVT (clib_bihash_kv) * add_v, int is_add,
int (*is_stale_cb) (BVT (clib_bihash_kv) *, void *), void *arg)
{
- u32 bucket_index;
BVT (clib_bihash_bucket) * b, tmp_b;
BVT (clib_bihash_value) * v, *new_v, *save_new_v, *working_copy;
int i, limit;
hash = BV (clib_bihash_hash) (add_v);
- bucket_index = hash & (h->nbuckets - 1);
- b = &h->buckets[bucket_index];
+ b = BV (clib_bihash_get_bucket) (h, hash);
hash >>= h->log2_nbuckets;
BVT (clib_bihash_kv) * search_key, BVT (clib_bihash_kv) * valuep)
{
u64 hash;
- u32 bucket_index;
BVT (clib_bihash_value) * v;
BVT (clib_bihash_bucket) * b;
int i, limit;
hash = BV (clib_bihash_hash) (search_key);
- bucket_index = hash & (h->nbuckets - 1);
- b = &h->buckets[bucket_index];
+ b = BV (clib_bihash_get_bucket) (h, hash);
if (BV (clib_bihash_bucket_is_empty) (b))
return -1;