| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_OS_H_ | 5 #ifndef VM_OS_H_ |
| 6 #define VM_OS_H_ | 6 #define VM_OS_H_ |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 | 9 |
| 10 // Forward declarations. | 10 // Forward declarations. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Returns number of available processor cores. | 75 // Returns number of available processor cores. |
| 76 static int NumberOfAvailableProcessors(); | 76 static int NumberOfAvailableProcessors(); |
| 77 | 77 |
| 78 // Sleep the currently executing thread for millis ms. | 78 // Sleep the currently executing thread for millis ms. |
| 79 static void Sleep(int64_t millis); | 79 static void Sleep(int64_t millis); |
| 80 | 80 |
| 81 // Debug break. | 81 // Debug break. |
| 82 static void DebugBreak(); | 82 static void DebugBreak(); |
| 83 | 83 |
| 84 // Not all platform support strndup. |
| 85 static char* StrNDup(const char* s, intptr_t n); |
| 86 |
| 84 // Print formatted output to stdout/stderr for debugging. | 87 // Print formatted output to stdout/stderr for debugging. |
| 85 static void Print(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); | 88 static void Print(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
| 86 static void PrintErr(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); | 89 static void PrintErr(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
| 87 static void VFPrint(FILE* stream, const char* format, va_list args); | 90 static void VFPrint(FILE* stream, const char* format, va_list args); |
| 88 // Print formatted output info a buffer. | 91 // Print formatted output info a buffer. |
| 89 // | 92 // |
| 90 // Does not write more than size characters (including the trailing '\0'). | 93 // Does not write more than size characters (including the trailing '\0'). |
| 91 // | 94 // |
| 92 // Returns the number of characters (excluding the trailing '\0') | 95 // Returns the number of characters (excluding the trailing '\0') |
| 93 // that would been written if the buffer had been big enough. If | 96 // that would been written if the buffer had been big enough. If |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 static void Shutdown(); | 128 static void Shutdown(); |
| 126 | 129 |
| 127 static void Abort(); | 130 static void Abort(); |
| 128 | 131 |
| 129 static void Exit(int code); | 132 static void Exit(int code); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace dart | 135 } // namespace dart |
| 133 | 136 |
| 134 #endif // VM_OS_H_ | 137 #endif // VM_OS_H_ |
| OLD | NEW |