X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=map%2Fskiplist.c;fp=map%2Fskiplist.c;h=f92d1405de0e5a0881d27eb74f70dac767a88ef1;hp=0746c00ed75b754aea4d3e876975b40efac548ec;hb=ff3c302d5e137d9653c656eee016bacf5d988d66;hpb=86fd9c8abfbacea2902b4fe42a8a4664b2a531cf diff --git a/map/skiplist.c b/map/skiplist.c index 0746c00..f92d140 100644 --- a/map/skiplist.c +++ b/map/skiplist.c @@ -27,7 +27,7 @@ #include "rcu.h" // Setting MAX_LEVELS to 1 essentially makes this data structure the Harris-Michael lock-free list (see list.c). -#define MAX_LEVELS 15 +#define MAX_LEVELS 24 enum unlink { FORCE_UNLINK, @@ -66,7 +66,7 @@ static inline node_t * STRIP_MARK(markable_t x) { return ((node_t *)STRIP_TAG(x, #endif static int random_levels (skiplist_t *sl) { - unsigned r = nbd_rand(); + uint64_t r = nbd_rand(); int z = __builtin_ctz(r); int levels = (int)(z / 1.5); if (levels == 0)