Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 17087010: Make the ninja pool math correct. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import hashlib 6 import hashlib
7 import multiprocessing 7 import multiprocessing
8 import os.path 8 import os.path
9 import re 9 import re
10 import signal 10 import signal
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 ("ullAvailPageFile", ctypes.c_ulonglong), 1354 ("ullAvailPageFile", ctypes.c_ulonglong),
1355 ("ullTotalVirtual", ctypes.c_ulonglong), 1355 ("ullTotalVirtual", ctypes.c_ulonglong),
1356 ("ullAvailVirtual", ctypes.c_ulonglong), 1356 ("ullAvailVirtual", ctypes.c_ulonglong),
1357 ("sullAvailExtendedVirtual", ctypes.c_ulonglong), 1357 ("sullAvailExtendedVirtual", ctypes.c_ulonglong),
1358 ] 1358 ]
1359 1359
1360 stat = MEMORYSTATUSEX() 1360 stat = MEMORYSTATUSEX()
1361 stat.dwLength = ctypes.sizeof(stat) 1361 stat.dwLength = ctypes.sizeof(stat)
1362 ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) 1362 ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
1363 1363
1364 return max(1, stat.ullTotalPhys / (4 ** 31)) 1364 return max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB
1365 else: 1365 else:
1366 # TODO(scottmg): Implement this for other platforms. 1366 # TODO(scottmg): Implement this for other platforms.
1367 return 1 1367 return 1
1368 1368
1369 1369
1370 def GenerateOutputForConfig(target_list, target_dicts, data, params, 1370 def GenerateOutputForConfig(target_list, target_dicts, data, params,
1371 config_name): 1371 config_name):
1372 options = params['options'] 1372 options = params['options']
1373 flavor = gyp.common.GetFlavor(params) 1373 flavor = gyp.common.GetFlavor(params)
1374 generator_flags = params.get('generator_flags', {}) 1374 generator_flags = params.get('generator_flags', {})
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 arglists.append( 1871 arglists.append(
1872 (target_list, target_dicts, data, params, config_name)) 1872 (target_list, target_dicts, data, params, config_name))
1873 pool.map(CallGenerateOutputForConfig, arglists) 1873 pool.map(CallGenerateOutputForConfig, arglists)
1874 except KeyboardInterrupt, e: 1874 except KeyboardInterrupt, e:
1875 pool.terminate() 1875 pool.terminate()
1876 raise e 1876 raise e
1877 else: 1877 else:
1878 for config_name in config_names: 1878 for config_name in config_names:
1879 GenerateOutputForConfig(target_list, target_dicts, data, params, 1879 GenerateOutputForConfig(target_list, target_dicts, data, params,
1880 config_name) 1880 config_name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698