OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_FUCHSIA) | 6 #if defined(HOST_OS_FUCHSIA) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 int OS::NumberOfAvailableProcessors() { | 149 int OS::NumberOfAvailableProcessors() { |
150 return sysconf(_SC_NPROCESSORS_CONF); | 150 return sysconf(_SC_NPROCESSORS_CONF); |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 uintptr_t OS::MaxRSS() { | 154 uintptr_t OS::MaxRSS() { |
155 mx_info_task_stats_t task_stats; | 155 mx_info_task_stats_t task_stats; |
156 mx_handle_t process = mx_process_self(); | 156 mx_handle_t process = mx_process_self(); |
157 mx_status_t status = mx_object_get_info( | 157 mx_status_t status = mx_object_get_info( |
158 process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL); | 158 process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL); |
159 return (status == NO_ERROR) | 159 return (status == MX_OK) |
160 ? (task_stats.mem_private_bytes + task_stats.mem_shared_bytes) | 160 ? (task_stats.mem_private_bytes + task_stats.mem_shared_bytes) |
161 : 0; | 161 : 0; |
162 } | 162 } |
163 | 163 |
164 | 164 |
165 void OS::Sleep(int64_t millis) { | 165 void OS::Sleep(int64_t millis) { |
166 SleepMicros(millis * kMicrosecondsPerMillisecond); | 166 SleepMicros(millis * kMicrosecondsPerMillisecond); |
167 } | 167 } |
168 | 168 |
169 | 169 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 | 312 |
313 | 313 |
314 void OS::Exit(int code) { | 314 void OS::Exit(int code) { |
315 UNIMPLEMENTED(); | 315 UNIMPLEMENTED(); |
316 } | 316 } |
317 | 317 |
318 } // namespace dart | 318 } // namespace dart |
319 | 319 |
320 #endif // defined(HOST_OS_FUCHSIA) | 320 #endif // defined(HOST_OS_FUCHSIA) |
OLD | NEW |