OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |