| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // from midnight January 1, 1970 UTC. | 43 // from midnight January 1, 1970 UTC. |
| 44 static int64_t GetCurrentTimeMillis(); | 44 static int64_t GetCurrentTimeMillis(); |
| 45 | 45 |
| 46 // Returns the current time in microseconds measured | 46 // Returns the current time in microseconds measured |
| 47 // from midnight January 1, 1970 UTC. | 47 // from midnight January 1, 1970 UTC. |
| 48 static int64_t GetCurrentTimeMicros(); | 48 static int64_t GetCurrentTimeMicros(); |
| 49 | 49 |
| 50 // Returns the current time used by the tracing infrastructure. | 50 // Returns the current time used by the tracing infrastructure. |
| 51 static int64_t GetCurrentMonotonicMicros(); | 51 static int64_t GetCurrentMonotonicMicros(); |
| 52 | 52 |
| 53 // Returns the raw clock value from the monotonic clock. |
| 54 static int64_t GetCurrentMonotonicTicks(); |
| 55 |
| 56 // Returns the frequency of the monotonic clock. |
| 57 static int64_t GetCurrentMonotonicFrequency(); |
| 58 |
| 53 // Returns a cleared aligned array of type T with n entries. | 59 // Returns a cleared aligned array of type T with n entries. |
| 54 // Alignment must be >= 16 and a power of two. | 60 // Alignment must be >= 16 and a power of two. |
| 55 template<typename T> | 61 template<typename T> |
| 56 static T* AllocateAlignedArray(intptr_t n, intptr_t alignment) { | 62 static T* AllocateAlignedArray(intptr_t n, intptr_t alignment) { |
| 57 T* result = reinterpret_cast<T*>(OS::AlignedAllocate(n * sizeof(*result), | 63 T* result = reinterpret_cast<T*>(OS::AlignedAllocate(n * sizeof(*result), |
| 58 alignment)); | 64 alignment)); |
| 59 memset(result, 0, n * sizeof(*result)); | 65 memset(result, 0, n * sizeof(*result)); |
| 60 return result; | 66 return result; |
| 61 } | 67 } |
| 62 | 68 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 static void Shutdown(); | 155 static void Shutdown(); |
| 150 | 156 |
| 151 static void Abort(); | 157 static void Abort(); |
| 152 | 158 |
| 153 static void Exit(int code); | 159 static void Exit(int code); |
| 154 }; | 160 }; |
| 155 | 161 |
| 156 } // namespace dart | 162 } // namespace dart |
| 157 | 163 |
| 158 #endif // VM_OS_H_ | 164 #endif // VM_OS_H_ |
| OLD | NEW |