From 11a02b035b464ab6813676adfd19c4a59c36d907 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 6 Sep 2021 12:22:54 -0300 Subject: misc: Add __get_nprocs_sched This is an internal function meant to return the number of avaliable processor where the process can scheduled, different than the __get_nprocs which returns a the system available online CPU. The Linux implementation currently only calls __get_nprocs(), which in tuns calls sched_getaffinity. Reviewed-by: Florian Weimer --- malloc/arena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'malloc') diff --git a/malloc/arena.c b/malloc/arena.c index 4c398753ae..78ef4cf18c 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -878,7 +878,7 @@ arena_get2 (size_t size, mstate avoid_arena) narenas_limit = mp_.arena_max; else if (narenas > mp_.arena_test) { - int n = __get_nprocs (); + int n = __get_nprocs_sched (); if (n >= 1) narenas_limit = NARENAS_FROM_NCORES (n); -- cgit 1.4.1