diff options
author | Steven Knight <knight@baldmt.com> | 2006-02-12 13:03:27 +0000 |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-02-12 13:03:27 +0000 |
commit | fb1dfce842e5fca82eb8e81111e9a3da041b74dc (patch) | |
tree | 0eed265a22c740b420618e119f47d84a22011da7 /src/engine/SCons/Debug.py | |
parent | 12dc08f973ed18d35376d16f7e4d572e60ca34ed (diff) | |
download | scons-fb1dfce842e5fca82eb8e81111e9a3da041b74dc.tar.gz |
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 bb49dbd3..cc97fe02 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) |