X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Ftest_urcu_assign.c;h=6e12b181450dac9d4e8683b86a3f4989ca8f56cd;hb=refs%2Ftags%2Fv0.7.10;hp=b510ec811ba855a5d4a8678dbe75144254f7e2a9;hpb=2d72fae24ceebe2efa486b5bad421f39917ec0a6;p=urcu.git diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c index b510ec8..6e12b18 100644 --- a/tests/test_urcu_assign.c +++ b/tests/test_urcu_assign.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; @@ -406,10 +400,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;