Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: dm/DMReporter.cpp

Issue 445963002: DM: expand peak RAM usage to Mac and Android too. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bar bar Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698