aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-09-06 12:22:54 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-09-27 09:13:06 -0300
commit11a02b035b464ab6813676adfd19c4a59c36d907 (patch)
treeaadaa54c5ca5608981c8a2482ec184d022a0730a /malloc
parent514638699d4b76826096a5f47136dc58f7619944 (diff)
downloadglibc-11a02b035b464ab6813676adfd19c4a59c36d907.zip
glibc-11a02b035b464ab6813676adfd19c4a59c36d907.tar.gz
glibc-11a02b035b464ab6813676adfd19c4a59c36d907.tar.bz2
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 <fweimer@redhat.com>
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 4c39875..78ef4cf 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);