X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=map%2Fskiplist.c;h=9887a43c7198f13e4b9930856289cf4228252968;hp=e9c9b55d55a46e14d066a1d7209e6fdb65d23771;hb=a03cf3b0c40e6c3b8b4877b49a64288cb3fcb919;hpb=e592519ef19f890e551c27f47ef8b773bb4860da diff --git a/map/skiplist.c b/map/skiplist.c index e9c9b55..9887a43 100644 --- a/map/skiplist.c +++ b/map/skiplist.c @@ -21,9 +21,10 @@ #include #include "common.h" -#include "runtime.h" #include "skiplist.h" +#include "runtime.h" #include "mem.h" +#include "rcu.h" // Setting MAX_LEVEL to 0 essentially makes this data structure the Harris-Michael lock-free list (in list.c). #define MAX_LEVEL 31 @@ -170,9 +171,9 @@ static node_t *find_preds (node_t **preds, node_t **succs, int n, skiplist_t *sl if (level == 0) { node_t *unlinked = GET_NODE(other); if (sl->key_type != NULL) { - nbd_defer_free((void *)unlinked->key); + rcu_defer_free((void *)unlinked->key); } - nbd_defer_free(unlinked); + rcu_defer_free(unlinked); } } else { TRACE("s3", "find_preds: lost race to unlink item %p from pred %p", item, pred); @@ -438,9 +439,9 @@ map_val_t sl_remove (skiplist_t *sl, map_key_t key) { TRACE("s2", "sl_remove: unlinked item %p from the skiplist at level 0", item, 0); // The thread that completes the unlink should free the memory. if (sl->key_type != NULL) { - nbd_defer_free((void *)item->key); + rcu_defer_free((void *)item->key); } - nbd_defer_free(item); + rcu_defer_free(item); } return val; }