Cleanup: tests: Branch condition evaluates to a garbage value
[urcu.git] / urcu / rculfhash.h
index 0a8abff3c7d226bb6e38873569edc480cee07013..d8c85bce3822e3cda716571257ca810dac0d7d9f 100644 (file)
@@ -133,7 +133,8 @@ struct cds_lfht *_cds_lfht_new(unsigned long init_size,
  * @min_nr_alloc_buckets: the minimum number of allocated buckets.
  *                        (must be power of two)
  * @max_nr_buckets: the maximum number of hash table buckets allowed.
- *                  (must be power of two)
+ *                  (must be power of two, 0 is accepted, means
+ *                  "infinite")
  * @flags: hash table creation flags (can be combined with bitwise or: '|').
  *           0: no flags.
  *           CDS_LFHT_AUTO_RESIZE: automatically resize hash table.
@@ -177,7 +178,8 @@ struct cds_lfht *cds_lfht_new(unsigned long init_size,
  * Return 0 on success, negative error value on error.
  * Threads calling this API need to be registered RCU read-side threads.
  * cds_lfht_destroy should *not* be called from a RCU read-side critical
- * section.
+ * section. It should *not* be called from a call_rcu thread context
+ * neither.
  */
 extern
 int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr);
@@ -439,6 +441,8 @@ int cds_lfht_is_node_deleted(struct cds_lfht_node *node);
  *
  * Threads calling this API need to be registered RCU read-side threads.
  * This function does not (necessarily) issue memory barriers.
+ * cds_lfht_resize should *not* be called from a RCU read-side critical
+ * section.
  */
 extern
 void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size);
@@ -467,7 +471,7 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size);
        for (cds_lfht_first(ht, iter),                                  \
                        pos = caa_container_of(cds_lfht_iter_get_node(iter), \
                                        __typeof__(*(pos)), member);    \
-               &(pos)->member != NULL;                                 \
+               cds_lfht_iter_get_node(iter) != NULL;                   \
                cds_lfht_next(ht, iter),                                \
                        pos = caa_container_of(cds_lfht_iter_get_node(iter), \
                                        __typeof__(*(pos)), member))
@@ -477,7 +481,7 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size);
        for (cds_lfht_lookup(ht, hash, match, key, iter),               \
                        pos = caa_container_of(cds_lfht_iter_get_node(iter), \
                                        __typeof__(*(pos)), member);    \
-               &(pos)->member != NULL;                                 \
+               cds_lfht_iter_get_node(iter) != NULL;                   \
                cds_lfht_next_duplicate(ht, match, key, iter),          \
                        pos = caa_container_of(cds_lfht_iter_get_node(iter), \
                                        __typeof__(*(pos)), member))
This page took 0.025569 seconds and 4 git commands to generate.