Skip to content
Commit e9b21313 authored by Fangrui Song's avatar Fangrui Song
Browse files

[Support] computeHostNumPhysicalCores: use sched_getaffinity for all...

[Support] computeHostNumPhysicalCores: use sched_getaffinity for all non-Android Linux with no custom implementation

Make the sched_getaffinity based implementation available to all architectures
(except s390x/x86 which have a custom implementation). The `CPU_ALLOC(2048)`
code supports all `CONFIG_NR_CPUS` values in Linux kernel `arch/*/configs/`.

The function is mainly used by in-process ThinLTO to decide the default number
of threads. Returning -1 will use just one thread.

Android is excluded because of the higher API level requirement:
`sched_getaffinity; # introduced-arm=12 introduced-arm64=21 introduced-x86=12 introduced-x86_64=21`
parent 57d0e9bf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment