X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=map%2Flist.c;fp=map%2Flist.c;h=bc191cd7ef79290f9b7c230e7320101e7b335236;hp=0d9c11f24f275254c238e9a538f5e8332b3b2729;hb=a1d0b3ca99552878b1becf561d8f3291992aaa67;hpb=ef7c7fd495750e0d26762df9f1a297500553874f diff --git a/map/list.c b/map/list.c index 0d9c11f..bc191cd 100644 --- a/map/list.c +++ b/map/list.c @@ -34,13 +34,14 @@ struct ll { }; // Marking the field of a node logically removes it from the list -#define MARK_NODE(x) TAG_VALUE((markable_t)(x), TAG1) -#define HAS_MARK(x) (IS_TAGGED((x), TAG1) == TAG1) +#define MARK_NODE(x) TAG_VALUE((markable_t)(x), 0x1) +#define HAS_MARK(x) (IS_TAGGED((x), 0x1) == 0x1) #define GET_NODE(x) ((node_t *)(x)) -#define STRIP_MARK(x) ((node_t *)STRIP_TAG((x), TAG1)) +#define STRIP_MARK(x) ((node_t *)STRIP_TAG((x), 0x1)) static node_t *node_alloc (map_key_t key, map_val_t val) { node_t *item = (node_t *)nbd_malloc(sizeof(node_t)); + assert(!HAS_MARK((size_t)item)); item->key = key; item->val = val; return item;