-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break out CPU count into internal function
One of the last pieces of code not in a function. This would normally never cause a problem, except that while we are running tests, we need to pretend to have a different OS to test OS specific data sources. When pretending to be Darwin, the CPU count would fail. By moving this check into an internal function we get to skip running it during tests, and the added benefit is that we only need to run it when LP_ENABLE_LOAD is true, saving startup time for those with it enabled. The downside being it is run every time lp_activate() is run, when rarely does a machine change the number of CPUs while a user is active. But with virtualization today, it is theoretically possible, so I count that as another benefit.
- Loading branch information
Showing
2 changed files
with
24 additions
and
3 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
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