OLD | NEW |
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/os.h" | 5 #include "vm/os.h" |
6 | 6 |
7 #include <android/log.h> | 7 #include <android/log.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <limits.h> | 9 #include <limits.h> |
10 #include <malloc.h> | 10 #include <malloc.h> |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return sysconf(_SC_NPROCESSORS_ONLN); | 302 return sysconf(_SC_NPROCESSORS_ONLN); |
303 } | 303 } |
304 | 304 |
305 | 305 |
306 void OS::Sleep(int64_t millis) { | 306 void OS::Sleep(int64_t millis) { |
307 // TODO(5411554): For now just use usleep we may have to revisit this. | 307 // TODO(5411554): For now just use usleep we may have to revisit this. |
308 usleep(millis * 1000); | 308 usleep(millis * 1000); |
309 } | 309 } |
310 | 310 |
311 | 311 |
| 312 void OS::DebugBreak() { |
| 313 UNIMPLEMENTED(); |
| 314 } |
| 315 |
| 316 |
312 void OS::Print(const char* format, ...) { | 317 void OS::Print(const char* format, ...) { |
313 va_list args; | 318 va_list args; |
314 va_start(args, format); | 319 va_start(args, format); |
315 VFPrint(stdout, format, args); | 320 VFPrint(stdout, format, args); |
316 // Forward to the Android log for remote access. | 321 // Forward to the Android log for remote access. |
317 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args); | 322 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args); |
318 va_end(args); | 323 va_end(args); |
319 } | 324 } |
320 | 325 |
321 | 326 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 void OS::Abort() { | 410 void OS::Abort() { |
406 abort(); | 411 abort(); |
407 } | 412 } |
408 | 413 |
409 | 414 |
410 void OS::Exit(int code) { | 415 void OS::Exit(int code) { |
411 exit(code); | 416 exit(code); |
412 } | 417 } |
413 | 418 |
414 } // namespace dart | 419 } // namespace dart |
OLD | NEW |