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

Side by Side Diff: runtime/vm/os_win.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_macos.cc ('k') | runtime/vm/service.h » ('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_WINDOWS) 6 #if defined(HOST_OS_WINDOWS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <malloc.h> // NOLINT 10 #include <malloc.h> // NOLINT
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 #error Unsupported architecture. 199 #error Unsupported architecture.
200 #endif 200 #endif
201 } 201 }
202 202
203 int OS::NumberOfAvailableProcessors() { 203 int OS::NumberOfAvailableProcessors() {
204 SYSTEM_INFO info; 204 SYSTEM_INFO info;
205 GetSystemInfo(&info); 205 GetSystemInfo(&info);
206 return info.dwNumberOfProcessors; 206 return info.dwNumberOfProcessors;
207 } 207 }
208 208
209 uintptr_t OS::MaxRSS() {
210 PROCESS_MEMORY_COUNTERS pmc;
211 GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc));
212 return pmc.PeakWorkingSetSize;
213 }
214
215 void OS::Sleep(int64_t millis) { 209 void OS::Sleep(int64_t millis) {
216 ::Sleep(millis); 210 ::Sleep(millis);
217 } 211 }
218 212
219 void OS::SleepMicros(int64_t micros) { 213 void OS::SleepMicros(int64_t micros) {
220 // Windows only supports millisecond sleeps. 214 // Windows only supports millisecond sleeps.
221 if (micros < kMicrosecondsPerMillisecond) { 215 if (micros < kMicrosecondsPerMillisecond) {
222 // Calling ::Sleep with 0 has no determined behaviour, round up. 216 // Calling ::Sleep with 0 has no determined behaviour, round up.
223 micros = kMicrosecondsPerMillisecond; 217 micros = kMicrosecondsPerMillisecond;
224 } 218 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // TODO(zra): Remove once VM shuts down cleanly. 403 // TODO(zra): Remove once VM shuts down cleanly.
410 private_flag_windows_run_tls_destructors = false; 404 private_flag_windows_run_tls_destructors = false;
411 // On Windows we use ExitProcess so that threads can't clobber the exit_code. 405 // On Windows we use ExitProcess so that threads can't clobber the exit_code.
412 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 406 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
413 ::ExitProcess(code); 407 ::ExitProcess(code);
414 } 408 }
415 409
416 } // namespace dart 410 } // namespace dart
417 411
418 #endif // defined(HOST_OS_WINDOWS) 412 #endif // defined(HOST_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/vm/os_macos.cc ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698