summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Debug.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-02-12 13:03:27 +0000
committerSteven Knight <knight@baldmt.com>2006-02-12 13:03:27 +0000
commitfb1dfce842e5fca82eb8e81111e9a3da041b74dc (patch)
tree0eed265a22c740b420618e119f47d84a22011da7 /src/engine/SCons/Debug.py
parent12dc08f973ed18d35376d16f7e4d572e60ca34ed (diff)
downloadscons-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.py13
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)