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 | faaf9c51fae2ef1dc6c67c3bc4c263b63dbc8987 (patch) | |
tree | 0eed265a22c740b420618e119f47d84a22011da7 /src | |
parent | 6c80eef9959691af782676c52c49eb9bab1a6808 (diff) | |
download | SCons-faaf9c51fae2ef1dc6c67c3bc4c263b63dbc8987.zip SCons-faaf9c51fae2ef1dc6c67c3bc4c263b63dbc8987.tar.gz SCons-faaf9c51fae2ef1dc6c67c3bc4c263b63dbc8987.tar.bz2 |
Support the --debug=memory option on Windows. (Baptiste Lepilleur)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 5 | ||||
-rw-r--r-- | src/engine/SCons/Debug.py | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 754768d..1407e3f 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -126,6 +126,11 @@ RELEASE 0.97 - XXX - Add x64 support for Microsoft Visual Studio 8. + From Baptiste Lepilleur: + + - Support the --debug=memory option on Windows when the Python version + has the win32process and win32api modules. + From Christian Maaser: - Add support for Visual Studio Express Editions. 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) |