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

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

Issue 2999933002: Revert "Add current rss and embedder name to Observatory" (Closed)
Patch Set: 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
203 void OS::Sleep(int64_t millis) { 211 void OS::Sleep(int64_t millis) {
204 int64_t micros = millis * kMicrosecondsPerMillisecond; 212 int64_t micros = millis * kMicrosecondsPerMillisecond;
205 SleepMicros(micros); 213 SleepMicros(micros);
206 } 214 }
207 215
208 void OS::SleepMicros(int64_t micros) { 216 void OS::SleepMicros(int64_t micros) {
209 struct timespec req; // requested. 217 struct timespec req; // requested.
210 struct timespec rem; // remainder. 218 struct timespec rem; // remainder.
211 int64_t seconds = micros / kMicrosecondsPerSecond; 219 int64_t seconds = micros / kMicrosecondsPerSecond;
212 if (seconds > kMaxInt32) { 220 if (seconds > kMaxInt32) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 abort(); 414 abort();
407 } 415 }
408 416
409 void OS::Exit(int code) { 417 void OS::Exit(int code) {
410 exit(code); 418 exit(code);
411 } 419 }
412 420
413 } // namespace dart 421 } // namespace dart
414 422
415 #endif // defined(HOST_OS_MACOS) 423 #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