From: Mathieu Desnoyers Date: Fri, 31 May 2013 17:50:33 +0000 (-0400) Subject: rcuja test: add specific free_node() X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9d5c85c8d9ab425e52759363de9f492c3206b7d6;p=userspace-rcu.git rcuja test: add specific free_node() Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_urcu_ja.c b/tests/test_urcu_ja.c index 8e14a9b..859dc16 100644 --- a/tests/test_urcu_ja.c +++ b/tests/test_urcu_ja.c @@ -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)++; }