X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_bp.c;h=75b60156812fdbadc4793b2cdb2f5d7728d9c297;hb=refs%2Fheads%2Fstable-0.7;hp=26ed741f6cca53fb04a5bb05400e891366fa169c;hpb=2d72fae24ceebe2efa486b5bad421f39917ec0a6;p=userspace-rcu.git diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c index 26ed741..75b6015 100644 --- a/tests/test_urcu_bp.c +++ b/tests/test_urcu_bp.c @@ -31,11 +31,11 @@ #include #include #include -#include #include #include #include +#include "cpuset.h" #ifdef __linux__ #include @@ -104,12 +104,6 @@ static int use_affinity = 0; pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER; -#ifndef HAVE_CPU_SET_T -typedef unsigned long cpu_set_t; -# define CPU_ZERO(cpuset) do { *(cpuset) = 0; } while(0) -# define CPU_SET(cpu, cpuset) do { *(cpuset) |= (1UL << (cpu)); } while(0) -#endif - static void set_affinity(void) { cpu_set_t mask; @@ -405,10 +399,10 @@ int main(int argc, char **argv) (unsigned long) gettid()); 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); - count_writer = malloc(sizeof(*count_writer) * 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)); + count_writer = calloc(nr_writers, sizeof(*count_writer)); next_aff = 0;