summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-17 21:14:44 (GMT)
committerRui Ueyama <ruiu@google.com>2015-04-17 21:14:48 (GMT)
commit8c8834acffdc0da0d94119725929acc712c9dfad (patch)
tree5c1c1e402345ca0391a041ea1922553d1f5db02a
parentce70cde4b17e2b506a824bb4b58bd7c82116514d (diff)
downloadNinja-8c8834acffdc0da0d94119725929acc712c9dfad.zip
Ninja-8c8834acffdc0da0d94119725929acc712c9dfad.tar.gz
Ninja-8c8834acffdc0da0d94119725929acc712c9dfad.tar.bz2
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.
-rw-r--r--src/util.cc2
1 files changed, 1 insertions, 1 deletions
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);