diff options
author | Steven Knight <knight@baldmt.com> | 2006-02-12 13:03:27 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-02-12 13:03:27 (GMT) |
commit | 8cddc4743be562bac3851eea6aa5b26a3c5370cd (patch) | |
tree | 0eed265a22c740b420618e119f47d84a22011da7 /src/engine/SCons/Debug.py | |
parent | e7bff6aa5ee0f0cbb687ba67cdbc7d696657638c (diff) | |
download | SCons-8cddc4743be562bac3851eea6aa5b26a3c5370cd.zip SCons-8cddc4743be562bac3851eea6aa5b26a3c5370cd.tar.gz SCons-8cddc4743be562bac3851eea6aa5b26a3c5370cd.tar.bz2 |
Support the --debug=memory option on Windows. (Baptiste Lepilleur)
Diffstat (limited to 'src/engine/SCons/Debug.py')
-rw-r--r-- | src/engine/SCons/Debug.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/engine/SCons/Debug.py b/src/engine/SCons/Debug.py index bb49dbd..cc97fe0 100644 --- a/src/engine/SCons/Debug.py +++ b/src/engine/SCons/Debug.py @@ -98,8 +98,17 @@ else: try: import resource except ImportError: - def memory(): - return 0 + try: + import win32process + import win32api + except ImportError: + def memory(): + return 0 + else: + def memory(): + process_handle = win32api.GetCurrentProcess() + memory_info = win32process.GetProcessMemoryInfo( process_handle ) + return memory_info['PeakWorkingSetSize'] else: def memory(): res = resource.getrusage(resource.RUSAGE_SELF) |