From d95bd16028d250211f2e65cd583e422f4ecdf7d0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 9 Jul 2011 16:34:29 -0400 Subject: [PATCH] rculfhash: document flags Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 5 +++++ urcu/rculfhash.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rculfhash.c b/rculfhash.c index 55f56ce..e814717 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -53,6 +53,11 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #endif +/* + * The removed flag needs to be updated atomically with the pointer. + * The dummy flag does not require to be updated atomically with the + * pointer, but it is added as a pointer low bit flag to save space. + */ #define REMOVED_FLAG (1UL << 0) #define DUMMY_FLAG (1UL << 1) #define FLAGS_MASK ((1UL << 2) - 1) diff --git a/urcu/rculfhash.h b/urcu/rculfhash.h index 5c5d4eb..b98b493 100644 --- a/urcu/rculfhash.h +++ b/urcu/rculfhash.h @@ -9,7 +9,7 @@ extern "C" { #endif struct _rcu_ht_node { - struct rcu_ht_node *next; + struct rcu_ht_node *next; /* ptr | DUMMY_FLAG | REMOVED_FLAG */ unsigned long reverse_hash; }; -- 2.34.1