X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Frculfhash.c;h=a7988a608cca0a32e64696ea8e29575c433dad9a;hb=6b6204e4fa85ff8e9a909bc2a029b62c3f5c6793;hp=a80a75a5fa3e7bc624ac9e46431a79188a849517;hpb=c17d7f44e29a4295d80e20a648c3975e8e226eeb;p=userspace-rcu.git diff --git a/src/rculfhash.c b/src/rculfhash.c index a80a75a..a7988a6 100644 --- a/src/rculfhash.c +++ b/src/rculfhash.c @@ -281,6 +281,7 @@ #include "workqueue.h" #include "urcu-die.h" #include "urcu-utils.h" +#include "compat-smp.h" /* * Split-counters lazily update the global counter each 1024 @@ -645,12 +646,11 @@ static long nr_cpus_mask = -1; static long split_count_mask = -1; static int split_count_order = -1; -#if defined(HAVE_SYSCONF) static void ht_init_nr_cpus_mask(void) { long maxcpus; - maxcpus = sysconf(_SC_NPROCESSORS_CONF); + maxcpus = get_possible_cpus_array_len(); if (maxcpus <= 0) { nr_cpus_mask = -2; return; @@ -662,12 +662,6 @@ static void ht_init_nr_cpus_mask(void) maxcpus = 1UL << cds_lfht_get_count_order_ulong(maxcpus); nr_cpus_mask = maxcpus - 1; } -#else /* #if defined(HAVE_SYSCONF) */ -static void ht_init_nr_cpus_mask(void) -{ - nr_cpus_mask = -2; -} -#endif /* #else #if defined(HAVE_SYSCONF) */ static void alloc_split_items_count(struct cds_lfht *ht)