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

Side by Side Diff: tools/ProcStats.cpp

Issue 2188643002: GN: dm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp deps Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/zlib/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "ProcStats.h" 8 #include "ProcStats.h"
9 #include "SkTypes.h"
9 10
10 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_ FOR_IOS) || defined(SK_BUILD_FOR_ANDROID) 11 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_ FOR_IOS) || defined(SK_BUILD_FOR_ANDROID)
11 #include <sys/resource.h> 12 #include <sys/resource.h>
12 int sk_tools::getMaxResidentSetSizeMB() { 13 int sk_tools::getMaxResidentSetSizeMB() {
13 struct rusage ru; 14 struct rusage ru;
14 getrusage(RUSAGE_SELF, &ru); 15 getrusage(RUSAGE_SELF, &ru);
15 #if defined(SK_BUILD_FOR_MAC) 16 #if defined(SK_BUILD_FOR_MAC)
16 return static_cast<int>(ru.ru_maxrss / 1024 / 1024); // Darwin reports bytes. 17 return static_cast<int>(ru.ru_maxrss / 1024 / 1024); // Darwin reports bytes.
17 #else 18 #else
18 return static_cast<int>(ru.ru_maxrss / 1024); // Linux reports kilobyte s. 19 return static_cast<int>(ru.ru_maxrss / 1024); // Linux reports kilobyte s.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 61
61 #elif defined(SK_BUILD_FOR_WIN32) 62 #elif defined(SK_BUILD_FOR_WIN32)
62 int sk_tools::getCurrResidentSetSizeMB() { 63 int sk_tools::getCurrResidentSetSizeMB() {
63 PROCESS_MEMORY_COUNTERS info; 64 PROCESS_MEMORY_COUNTERS info;
64 GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info)); 65 GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info));
65 return static_cast<int>(info.WorkingSetSize / 1024 / 1024); // Windows reports bytes. 66 return static_cast<int>(info.WorkingSetSize / 1024 / 1024); // Windows reports bytes.
66 } 67 }
67 #else 68 #else
68 int sk_tools::getCurrResidentSetSizeMB() { return -1; } 69 int sk_tools::getCurrResidentSetSizeMB() { return -1; }
69 #endif 70 #endif
OLDNEW
« no previous file with comments | « third_party/zlib/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698