X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=blobdiff_plain;f=tests%2Ftest_urcu_gc.c;h=62e7039cc4388f58efef7271f21a231158ef0eed;hp=498abc60817a7c03c6214bdd14e2b331cb6b6cd6;hb=f90535ef41a3ddef0c8bcd76a6ecb89f3fd09fc3;hpb=baf05c7167c29785d968404dec7e90cd428cc4cd diff --git a/tests/test_urcu_gc.c b/tests/test_urcu_gc.c index 498abc6..62e7039 100644 --- a/tests/test_urcu_gc.c +++ b/tests/test_urcu_gc.c @@ -416,11 +416,11 @@ 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); - tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers); - pending_reclaims = malloc(sizeof(*pending_reclaims) * 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)); + tot_nr_writes = calloc(nr_writers, sizeof(*tot_nr_writes)); + pending_reclaims = calloc(nr_writers, sizeof(*pending_reclaims)); if (reclaim_batch * sizeof(*pending_reclaims[i].queue) < CAA_CACHE_LINE_SIZE) for (i = 0; i < nr_writers; i++)