Index: dm/DMReporter.cpp |
diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp |
index 5187a6f453ae6ab086793756d58e42436d83558a..14f50871021ea42e811e547fc452b48089c2f300 100644 |
--- a/dm/DMReporter.cpp |
+++ b/dm/DMReporter.cpp |
@@ -4,12 +4,16 @@ |
#include "SkCommonFlags.h" |
#include "OverwriteLine.h" |
-#ifdef SK_BUILD_FOR_UNIX |
+#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_ANDROID) |
#include <sys/resource.h> |
static long get_max_rss_kb() { |
struct rusage ru; |
getrusage(RUSAGE_SELF, &ru); |
- return ru.ru_maxrss; |
+ #if defined(SK_BUILD_FOR_MAC) |
+ return ru.ru_maxrss / 1024; // Darwin reports bytes. |
+ #else |
+ return ru.ru_maxrss; // Linux reports kilobytes. |
+ #endif |
} |
#else |
static long get_max_rss_kb() { return 0; } |