X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_bp.c;h=52e7f457621939983cf2ca0e18e877399197029d;hb=65fcc7e9957a1658327acd121c3d8c3b36f4a94e;hp=7f20a6a060233c4795ae5ed01d0a9aef4891c748;hpb=06f22bdbb0c4c4d5db42a2e2dc35818aa61415be;p=urcu.git diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c index 7f20a6a..52e7f45 100644 --- a/tests/test_urcu_bp.c +++ b/tests/test_urcu_bp.c @@ -31,12 +31,15 @@ #include #include #include -#include #include #include #include +#ifdef __linux__ +#include +#endif + /* hardcoded number of CPUs */ #define NR_CPUS 16384 @@ -396,7 +399,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);