* Include this file _after_ including your URCU flavor.
*/
-#include <stdint.h>
#include <urcu/compiler.h>
#include <urcu-call-rcu.h>
#include <urcu-flavor.h>
#include <stdint.h>
-#include <urcu/rcuhlist.h>
#ifdef __cplusplus
extern "C" {
{
}
+/*
+ * Note: key UINT64_MAX is reserved internally for iteration.
+ */
+
/*
* cds_ja_lookup - look up by key.
* @ja: the Judy array.
*/
#define cds_ja_for_each_key_rcu(ja, key, pos) \
for ((key) = 0; \
- ((pos) = cds_ja_lookup_above_equal(ja, key, &(key))); )
+ ((key) != UINT64_MAX ? \
+ ((pos) = cds_ja_lookup_above_equal(ja, key, &(key))) : 0); \
+ (key)++)
/*
* cds_ja_for_each_key_prev_rcu: Iterate over all keys in descending order.
* Safe against node removal during iteration.
*/
#define cds_ja_for_each_key_prev_rcu(ja, key, pos) \
- for ((key) = UINT64_MAX; \
- ((pos) = cds_ja_lookup_below_equal(ja, key, &(key))); )
+ for ((key) = UINT64_MAX - 1; \
+ ((key) != UINT64_MAX ? \
+ ((pos) = cds_ja_lookup_below_equal(ja, key, &(key))) : 0); \
+ (key)--)
#ifdef __cplusplus
}