rculfhash: Remove "value" pointer
[urcu.git] / tests / test_urcu_hash.c
index 59356568bb2602cedea8c98e847f0a9dfe829862..9bb7da721232626e44e2dfeed2d51a12bff6d892 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 
 #define HASH_SIZE      32
-#define RAND_POOL      1000
+#define RAND_POOL      10000
 
 /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
 #define CACHE_LINE_SIZE 4096
@@ -403,11 +403,14 @@ void *thr_writer(void *_count)
                        rcu_read_lock();
                        ht_node_init(node,
                                (void *)(unsigned long)(rand_r(&rand_lookup) % RAND_POOL),
-                               sizeof(void *),
-                               (void *) 0x42);
-                       ht_add(test_ht, node);
+                               sizeof(void *));
+                       ret = ht_add_unique(test_ht, node);
                        rcu_read_unlock();
-                       nr_add++;
+                       if (ret) {
+                               free(node);
+                               nr_addexist++;
+                       } else
+                               nr_add++;
                } else {
                        /* May delete */
                        rcu_read_lock();
This page took 0.023779 seconds and 4 git commands to generate.