From: Rui Ueyama Date: Fri, 17 Apr 2015 21:14:44 +0000 (-0700) Subject: Run more than 34 processes on Win32 if we have 32+ cores. X-Git-Tag: v1.6.0^2~9^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c8834acffdc0da0d94119725929acc712c9dfad;p=platform%2Fupstream%2Fninja.git Run more than 34 processes on Win32 if we have 32+ cores. 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. --- diff --git a/src/util.cc b/src/util.cc index 720ccbd..aa47f2f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -500,7 +500,7 @@ string StripAnsiEscapeCodes(const string& in) { int GetProcessorCount() { #ifdef _WIN32 SYSTEM_INFO info; - GetSystemInfo(&info); + GetNativeSystemInfo(&info); return info.dwNumberOfProcessors; #else return sysconf(_SC_NPROCESSORS_ONLN);