rcuja test: add specific free_node()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 31 May 2013 17:50:33 +0000 (13:50 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 31 May 2013 17:50:33 +0000 (13:50 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_urcu_ja.c

index 8e14a9b2c05216d17509897a40e140bd9dc13732..859dc166e48f55d1425204f6696b26cc5ae9d52e 100644 (file)
@@ -145,15 +145,21 @@ struct ja_test_node *node_alloc(void)
 }
 
 static
-void free_node_cb(struct rcu_head *head)
+void free_node(struct ja_test_node *node)
 {
-       struct ja_test_node *node =
-               caa_container_of(head, struct ja_test_node, node.head);
        poison_free(node);
        if (leak_detection)
                uatomic_inc(&test_nodes_freed);
 }
 
+static
+void free_node_cb(struct rcu_head *head)
+{
+       struct ja_test_node *node =
+               caa_container_of(head, struct ja_test_node, node.head);
+       free_node(node);
+}
+
 #if 0
 static
 void test_delete_all_nodes(struct cds_lfht *ht)
@@ -695,7 +701,7 @@ void *test_ja_rw_thr_writer(void *_count)
                        if (add_unique) {
                                ret_node = cds_ja_add_unique(test_ja, key, &node->node);
                                if (ret_node != &node->node) {
-                                       free(node);
+                                       free_node(node);
                                        URCU_TLS(nr_addexist)++;
                                } else {
                                        URCU_TLS(nr_add)++;
@@ -706,7 +712,7 @@ void *test_ja_rw_thr_writer(void *_count)
                                ret = cds_ja_add(test_ja, key, &node->node);
                                if (ret) {
                                        fprintf(stderr, "Error in cds_ja_add: %d\n", ret);
-                                       free(node);
+                                       free_node(node);
                                } else {
                                        URCU_TLS(nr_add)++;
                                }
This page took 0.027497 seconds and 4 git commands to generate.