Commit 70c9726e authored by Committed by Marge BotBrowse files
util: Consider CPU affinity when detecting number of CPUs
A similar path can be used on at least FreeBSD using cpuset_getaffinity. This is how Ninja determines the number of available CPUs on that platform. See the GetProcessorCount function in util.cc: https://github.com/ninja-build/ninja/blob/master/src/util.cc v2: Fix counting the number of available CPUs. The CPU_COUNT API does not work the way I thought it did.
🤦Noticed by Marek. Reviewed-by: Adam Jackson <email@example.com> [v1] Reviewed-by: Pierre-Eric Pelloux-Prayer <firstname.lastname@example.org> [v1] Reviewed-by: Marek Olšák <email@example.com> Part-of: <!11228>
Showing with 34 additions and 5 deletions