X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_assign.c;h=851b8506b9bc85791b77fb5fad12fdc88ea8508c;hb=65fcc7e9957a1658327acd121c3d8c3b36f4a94e;hp=481cdd671a1a31ac5fea8213aa900c9e5ff6b8c3;hpb=5481ddb381061bda64aebc039900d21cac6a6caf;p=urcu.git diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c index 481cdd6..851b850 100644 --- a/tests/test_urcu_assign.c +++ b/tests/test_urcu_assign.c @@ -31,12 +31,15 @@ #include #include #include -#include #include #include #include +#ifdef __linux__ +#include +#endif + /* hardcoded number of CPUs */ #define NR_CPUS 16384 @@ -83,7 +86,7 @@ static unsigned long wduration; static inline void loop_sleep(unsigned long l) { while(l-- != 0) - cpu_relax(); + caa_cpu_relax(); } static int verbose_mode; @@ -399,7 +402,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);