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

Side by Side Diff: runtime/vm/os_macos.cc

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Rebase and Merge Created 3 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 | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(HOST_OS_MACOS) 6 #if defined(HOST_OS_MACOS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 ASSERT(Utils::IsPowerOfTwo(alignment)); 193 ASSERT(Utils::IsPowerOfTwo(alignment));
194 ASSERT(alignment >= kMinimumAlignment); 194 ASSERT(alignment >= kMinimumAlignment);
195 ASSERT(alignment <= OS::kMaxPreferredCodeAlignment); 195 ASSERT(alignment <= OS::kMaxPreferredCodeAlignment);
196 return alignment; 196 return alignment;
197 } 197 }
198 198
199 int OS::NumberOfAvailableProcessors() { 199 int OS::NumberOfAvailableProcessors() {
200 return sysconf(_SC_NPROCESSORS_ONLN); 200 return sysconf(_SC_NPROCESSORS_ONLN);
201 } 201 }
202 202
203 uintptr_t OS::MaxRSS() {
204 struct rusage usage;
205 usage.ru_maxrss = 0;
206 int r = getrusage(RUSAGE_SELF, &usage);
207 ASSERT(r == 0);
208 return usage.ru_maxrss;
209 }
210
211 void OS::Sleep(int64_t millis) { 203 void OS::Sleep(int64_t millis) {
212 int64_t micros = millis * kMicrosecondsPerMillisecond; 204 int64_t micros = millis * kMicrosecondsPerMillisecond;
213 SleepMicros(micros); 205 SleepMicros(micros);
214 } 206 }
215 207
216 void OS::SleepMicros(int64_t micros) { 208 void OS::SleepMicros(int64_t micros) {
217 struct timespec req; // requested. 209 struct timespec req; // requested.
218 struct timespec rem; // remainder. 210 struct timespec rem; // remainder.
219 int64_t seconds = micros / kMicrosecondsPerSecond; 211 int64_t seconds = micros / kMicrosecondsPerSecond;
220 if (seconds > kMaxInt32) { 212 if (seconds > kMaxInt32) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 abort(); 406 abort();
415 } 407 }
416 408
417 void OS::Exit(int code) { 409 void OS::Exit(int code) {
418 exit(code); 410 exit(code);
419 } 411 }
420 412
421 } // namespace dart 413 } // namespace dart
422 414
423 #endif // defined(HOST_OS_MACOS) 415 #endif // defined(HOST_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698