malloc: Use __get_nprocs on arena_get2 (BZ 30945)
commit472894d2cfee5751b44c0aaa71ed87df81c8e62e
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 11 Oct 2023 16:43:56 +0000 (11 13:43 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 22 Nov 2023 12:39:29 +0000 (22 09:39 -0300)
treebd3868820f0d21751f893fa1b152358b76d1e558
parentbd70d3bacfcd53b04b5b5dd7a5d10062ac6fa50a
malloc: Use __get_nprocs on arena_get2 (BZ 30945)

This restore the 2.33 semantic for arena_get2.  It was changed by
11a02b035b46 to avoid arena_get2 call malloc (back when __get_nproc
was refactored to use an scratch_buffer - 903bc7dcc2acafc).  The
__get_nproc was refactored over then and now it also avoid to call
malloc.

The 11a02b035b46 did not take in consideration any performance
implication, which should have been discussed properly.  The
__get_nprocs_sched is still used as a fallback mechanism if procfs
and sysfs is not acessible.

Checked on x86_64-linux-gnu.
Reviewed-by: DJ Delorie <dj@redhat.com>
include/sys/sysinfo.h
malloc/arena.c
misc/getsysstats.c
sysdeps/mach/getsysstats.c
sysdeps/unix/sysv/linux/getsysstats.c