* _after_ including your URCU flavor.
*/
+#include <urcu/config.h>
#include <stdint.h>
#include <pthread.h>
#include <urcu/compiler.h>
extern "C" {
#endif
+struct cds_lfht;
+
/*
* cds_lfht_node: Contains the next pointers and reverse-hash
* value required for lookup and traversal of the hash table.
/* cds_lfht_iter: Used to track state while traversing a hash chain. */
struct cds_lfht_iter {
struct cds_lfht_node *node, *next;
+ /*
+ * For debugging purposes, build both API users and rculfhash
+ * library with CDS_LFHT_ITER_DEBUG defined. This enables extra
+ * consistency checks for calls to a cds_lfht_next() or
+ * cds_lfht_next_duplicate() after the iterator has been
+ * re-purposed to iterate on a different hash table. This is a
+ * common programming mistake when performing hash table lookup
+ * nested in a hash table traversal.
+ */
+#ifdef CONFIG_CDS_LFHT_ITER_DEBUG
+ struct cds_lfht *lfht;
+#endif
};
static inline
return iter->node;
}
-struct cds_lfht;
struct rcu_flavor_struct;
/*
* (detection of memory corruption).
*/
static inline
-void cds_lfht_node_init(struct cds_lfht_node *node)
+void cds_lfht_node_init(struct cds_lfht_node *node __attribute__((unused)))
{
}
* This function does not issue any memory barrier.
*/
extern
-int cds_lfht_is_node_deleted(struct cds_lfht_node *node);
+int cds_lfht_is_node_deleted(const struct cds_lfht_node *node);
/*
* cds_lfht_resize - Force a hash table resize