For compatiblity reason, dwNumberOfProcessors in Win32 is capped at 32.
So even if your machine has more than 32 cores, Ninja spawns at most 34
subprocesses. This patch fixes the issue by using GetNativeSystemInfo,
which returns the system info from Wow64 point of view, instead of
GetSystemInfo.
int GetProcessorCount() {
#ifdef _WIN32
SYSTEM_INFO info;
- GetSystemInfo(&info);
+ GetNativeSystemInfo(&info);
return info.dwNumberOfProcessors;
#else
return sysconf(_SC_NPROCESSORS_ONLN);