From bcd278dfd2d2b9ac6569d3962fa8484842d60617 Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 6 Aug 2014 07:46:30 -0700 Subject: [PATCH] DM: expand peak RAM usage to Mac and Android too. BUG=skia: NOTREECHECKS=true R=halcanary@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/445963002 --- dm/DMReporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp index 5187a6f453..14f5087102 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 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; } -- 2.34.1