Cleanup: Re-organise source dir
[urcu.git] / tests / benchmark / test_urcu_hash_rw.c
index 8802b9cd0a621d1d07fee0f4e7bfe368f0a287b6..f72e20b8210c727ca0af02b9cb94f6dc6aec07c9 100644 (file)
@@ -20,7 +20,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
 #include "test_urcu_hash.h"
 
 enum urcu_hash_addremove {
@@ -121,7 +120,6 @@ void *test_hash_rw_thr_reader(void *_count)
 void *test_hash_rw_thr_writer(void *_count)
 {
        struct lfht_test_node *node;
-       struct cds_lfht_node *ret_node;
        struct cds_lfht_iter iter;
        struct wr_count *count = _count;
        int ret;
@@ -141,6 +139,8 @@ void *test_hash_rw_thr_writer(void *_count)
        cmm_smp_mb();
 
        for (;;) {
+               struct cds_lfht_node *ret_node = NULL;
+
                if ((addremove == AR_ADD || add_only)
                                || (addremove == AR_RANDOM && rand_r(&URCU_TLS(rand_lookup)) & 1)) {
                        node = malloc(sizeof(struct lfht_test_node));
@@ -231,7 +231,6 @@ void *test_hash_rw_thr_writer(void *_count)
 int test_hash_rw_populate_hash(void)
 {
        struct lfht_test_node *node;
-       struct cds_lfht_node *ret_node;
 
        if (!init_populate)
                return 0;
@@ -247,6 +246,8 @@ int test_hash_rw_populate_hash(void)
        }
 
        while (URCU_TLS(nr_add) < init_populate) {
+               struct cds_lfht_node *ret_node = NULL;
+
                node = malloc(sizeof(struct lfht_test_node));
                lfht_test_node_init(node,
                        (void *)(((unsigned long) rand_r(&URCU_TLS(rand_lookup)) % init_pool_size) + init_pool_offset),
This page took 0.02322 seconds and 4 git commands to generate.