Index: tools/ProcStats.cpp |
diff --git a/tools/ProcStats.cpp b/tools/ProcStats.cpp |
index eaa1379301833cb28e218345e7d6d31c95863bb8..c9f9f3f6c55d3da680faad2b659e2622a9b757f3 100644 |
--- a/tools/ProcStats.cpp |
+++ b/tools/ProcStats.cpp |
@@ -22,8 +22,16 @@ |
#endif |
} |
-#else |
+#elif defined(SK_BUILD_FOR_WIN32) |
+ #include <windows.h> |
+ #include <psapi.h> |
+ int sk_tools::getMaxResidentSetSizeMB() { |
+ PROCESS_MEMORY_COUNTERS info; |
+ GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info)); |
+ return static_cast<int>(info.PeakWorkingSetSize / 1024 / 1024); // Windows reports bytes. |
+ } |
+#else |
int sk_tools::getMaxResidentSetSizeMB() { |
return -1; |
} |