X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu.c;h=f1b2f21b1044cf32b7bd5c0515dcd556789eefbe;hb=65fcc7e9957a1658327acd121c3d8c3b36f4a94e;hp=e6a648981ed8b6b5a0abb679771d98d5e695dd9b;hpb=06f22bdbb0c4c4d5db42a2e2dc35818aa61415be;p=urcu.git diff --git a/tests/test_urcu.c b/tests/test_urcu.c index e6a6489..f1b2f21 100644 --- a/tests/test_urcu.c +++ b/tests/test_urcu.c @@ -31,12 +31,15 @@ #include #include #include -#include #include #include #include +#ifdef __linux__ +#include +#endif + /* hardcoded number of CPUs */ #define NR_CPUS 16384 @@ -400,7 +403,7 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - test_array = malloc(sizeof(*test_array) * ARRAY_SIZE); + test_array = calloc(1, sizeof(*test_array) * ARRAY_SIZE); tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers);