X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu.c;h=f1b2f21b1044cf32b7bd5c0515dcd556789eefbe;hb=dc745ef621c02934b89f5c1764fc0c51c51ccb1e;hp=eeea7f55e2253853323525ad94076a070390b14e;hpb=5481ddb381061bda64aebc039900d21cac6a6caf;p=urcu.git diff --git a/tests/test_urcu.c b/tests/test_urcu.c index eeea7f5..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 @@ -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; @@ -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);