projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rculfhash test: add missing free
[urcu.git]
/
tests
/
test_urcu_hash.c
diff --git
a/tests/test_urcu_hash.c
b/tests/test_urcu_hash.c
index 59356568bb2602cedea8c98e847f0a9dfe829862..92816674dc97a99bc4c96f4b7cf6268706eea569 100644
(file)
--- a/
tests/test_urcu_hash.c
+++ b/
tests/test_urcu_hash.c
@@
-38,7
+38,7
@@
#endif
#define HASH_SIZE 32
#endif
#define HASH_SIZE 32
-#define RAND_POOL 1000
+#define RAND_POOL 1000
0
/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096
/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
#define CACHE_LINE_SIZE 4096
@@
-405,9
+405,13
@@
void *thr_writer(void *_count)
(void *)(unsigned long)(rand_r(&rand_lookup) % RAND_POOL),
sizeof(void *),
(void *) 0x42);
(void *)(unsigned long)(rand_r(&rand_lookup) % RAND_POOL),
sizeof(void *),
(void *) 0x42);
-
ht_add
(test_ht, node);
+
ret = ht_add_unique
(test_ht, node);
rcu_read_unlock();
rcu_read_unlock();
- nr_add++;
+ if (ret) {
+ free(node);
+ nr_addexist++;
+ } else
+ nr_add++;
} else {
/* May delete */
rcu_read_lock();
} else {
/* May delete */
rcu_read_lock();
This page took
0.024788 seconds
and
4
git commands to generate.