X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_hash.c;h=3d7ee69fc74bcc6d817fd3d6ea71e0fa94c32ca7;hb=de07ab9691f011d2458be8c1239d62aaa6cb6100;hp=a2b5b7bca656902dc11b3d3e3d2902a8235df0c0;hpb=2d72fae24ceebe2efa486b5bad421f39917ec0a6;p=userspace-rcu.git diff --git a/tests/test_urcu_hash.c b/tests/test_urcu_hash.c index a2b5b7b..3d7ee69 100644 --- a/tests/test_urcu_hash.c +++ b/tests/test_urcu_hash.c @@ -82,13 +82,13 @@ int (*get_populate_hash_cb(void))(void) return test_hash_cb[test_choice].populate_hash; } -DEFINE_URCU_TLS(unsigned int, rand_lookup); -DEFINE_URCU_TLS(unsigned long, nr_add); -DEFINE_URCU_TLS(unsigned long, nr_addexist); -DEFINE_URCU_TLS(unsigned long, nr_del); -DEFINE_URCU_TLS(unsigned long, nr_delnoent); -DEFINE_URCU_TLS(unsigned long, lookup_fail); -DEFINE_URCU_TLS(unsigned long, lookup_ok); +__DEFINE_URCU_TLS_GLOBAL(unsigned int, rand_lookup); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, nr_add); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, nr_addexist); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, nr_del); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, nr_delnoent); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, lookup_fail); +__DEFINE_URCU_TLS_GLOBAL(unsigned long, lookup_ok); struct cds_lfht *test_ht; @@ -540,10 +540,10 @@ int main(int argc, char **argv) "main", (unsigned long) pthread_self(), (unsigned long) gettid()); - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); - tid_writer = malloc(sizeof(*tid_writer) * nr_writers); - count_reader = malloc(sizeof(*count_reader) * nr_readers); - count_writer = malloc(sizeof(*count_writer) * nr_writers); + tid_reader = calloc(nr_readers, sizeof(*tid_reader)); + tid_writer = calloc(nr_writers, sizeof(*tid_writer)); + count_reader = calloc(nr_readers, sizeof(*count_reader)); + count_writer = calloc(nr_writers, sizeof(*count_writer)); err = create_all_cpu_call_rcu_data(0); if (err) {