Chromium Code Reviews| Index: pylib/gyp/generator/ninja.py |
| =================================================================== |
| --- pylib/gyp/generator/ninja.py (revision 1722) |
| +++ pylib/gyp/generator/ninja.py (working copy) |
| @@ -1506,7 +1506,9 @@ |
| stat.dwLength = ctypes.sizeof(stat) |
| ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) |
| - return max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB |
| + mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB |
| + cpu_limit = multiprocessing.cpu_count() |
|
scottmg
2013/09/11 20:09:06
that does
if sys.platform == 'win32':
|
| + return min(mem_limit, cpu_limit) |
| elif sys.platform.startswith('linux'): |
| with open("/proc/meminfo") as meminfo: |
| memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') |