Don't limit CpuCountOverride to nproc

This commit is contained in:
Luke Street 2020-04-13 01:10:03 -04:00
parent 6a8714c1f3
commit 776e9394ac
1 changed files with 4 additions and 3 deletions

View File

@ -46,6 +46,10 @@ void SetCpuCountOverride(int argc, const SystemChar** argv) {
} }
static int GetCPUCount() { static int GetCPUCount() {
if (CpuCountOverride > 0) {
return CpuCountOverride;
}
int ret; int ret;
#if _WIN32 #if _WIN32
SYSTEM_INFO sysinfo; SYSTEM_INFO sysinfo;
@ -55,9 +59,6 @@ static int GetCPUCount() {
ret = sysconf(_SC_NPROCESSORS_ONLN); ret = sysconf(_SC_NPROCESSORS_ONLN);
#endif #endif
if (CpuCountOverride)
return std::min(CpuCountOverride, ret);
return ret; return ret;
} }