From d204976c7a81f45be52c0b92ab57c5c2b3105cbf Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sat, 7 Dec 2013 13:46:22 -0500 Subject: [PATCH] ck_ht: Backport probe sequence from ck_hs. --- src/ck_ht.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ck_ht.c b/src/ck_ht.c index 09c827a..f748fee 100644 --- a/src/ck_ht.c +++ b/src/ck_ht.c @@ -167,13 +167,14 @@ ck_ht_map_probe_next(struct ck_ht_map *map, size_t offset, ck_ht_hash_t h, size_ { ck_ht_hash_t r; size_t stride; + unsigned long level = (unsigned long)probes >> CK_HT_BUCKET_SHIFT; - (void)probes; - r.value = h.value >> map->step; + r.value = (h.value >> map->step) >> level; stride = (r.value & ~CK_HT_BUCKET_MASK) << 1 | (r.value & CK_HT_BUCKET_MASK); - return (offset + (stride | CK_HT_BUCKET_LENGTH)) & map->mask; + return (offset + level + + (stride | CK_HT_BUCKET_LENGTH)) & map->mask; } bool