cds_lfht_is_node_deleted parameter can be marked const
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 28 Oct 2019 19:24:36 +0000 (15:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 28 Oct 2019 19:26:59 +0000 (15:26 -0400)
Mark the cds_lfht_node pointer parameter of cds_lfht_is_node_deleted
as const. The fact that this parameter is mutable makes it harder to
use liburcu in const-correct code.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/urcu/rculfhash.h
src/rculfhash.c

index cbf513ec848c37744bb084a72ff66dd19f8c1816..20b822fa8dddc572c5e114c31a1963f4ed499be3 100644 (file)
@@ -499,7 +499,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node);
  * This function does not issue any memory barrier.
  */
 extern
  * 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
 
 /*
  * cds_lfht_resize - Force a hash table resize
index 811d5156ccdebc06679758ea282c9df22060fd16..51972c8d1b318c618776a8d0b4b26e5373b9dbae 100644 (file)
@@ -826,7 +826,7 @@ struct cds_lfht_node *clear_flag(struct cds_lfht_node *node)
 }
 
 static
 }
 
 static
-int is_removed(struct cds_lfht_node *node)
+int is_removed(const struct cds_lfht_node *node)
 {
        return ((unsigned long) node) & REMOVED_FLAG;
 }
 {
        return ((unsigned long) node) & REMOVED_FLAG;
 }
@@ -1830,7 +1830,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node)
        return ret;
 }
 
        return ret;
 }
 
-int cds_lfht_is_node_deleted(struct cds_lfht_node *node)
+int cds_lfht_is_node_deleted(const struct cds_lfht_node *node)
 {
        return is_removed(CMM_LOAD_SHARED(node->next));
 }
 {
        return is_removed(CMM_LOAD_SHARED(node->next));
 }
This page took 0.02619 seconds and 4 git commands to generate.