Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the CPU core count detection
See theofidry/cpu-core-counter#11 for the motivations. The code should be sensibly the same, the notable differences are: - fixed the deprecated usage of `hw.ncpu` - /proc/cpuinfo is check _last_ - nproc is checked first (before was not checked at all, it's considered to be more accurate and less convoluted than cpuinfo though) - not sure about the `return 2`, but this was not too clear [here](#514 (review)) neither. I could otherwise change the fallback value to return `1` if `proc_open` doesn't exist and 2 otherwise - add more ways to find the CPU cores count
- Loading branch information
1 parent
3c3b17f
commit 323451a
Showing
3 changed files
with
70 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters