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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Returns an aligned pointer in the C heap with room for size bytes. | 59 // Returns an aligned pointer in the C heap with room for size bytes. |
60 // Alignment must be >= 16 and a power of two. | 60 // Alignment must be >= 16 and a power of two. |
61 static void* AlignedAllocate(intptr_t size, intptr_t alignment); | 61 static void* AlignedAllocate(intptr_t size, intptr_t alignment); |
62 | 62 |
63 // Frees a pointer returned from AlignedAllocate. | 63 // Frees a pointer returned from AlignedAllocate. |
64 static void AlignedFree(void* ptr); | 64 static void AlignedFree(void* ptr); |
65 | 65 |
66 // Returns the activation frame alignment constraint or one if | 66 // Returns the activation frame alignment constraint or one if |
67 // the platform doesn't care. Guaranteed to be a power of two. | 67 // the platform doesn't care. Guaranteed to be a power of two. |
68 static word ActivationFrameAlignment(); | 68 static intptr_t ActivationFrameAlignment(); |
69 | 69 |
70 // This constant is guaranteed to be greater or equal to the | 70 // This constant is guaranteed to be greater or equal to the |
71 // preferred code alignment on all platforms. | 71 // preferred code alignment on all platforms. |
72 static const int kMaxPreferredCodeAlignment = 32; | 72 static const int kMaxPreferredCodeAlignment = 32; |
73 | 73 |
74 // Returns the preferred code alignment or zero if | 74 // Returns the preferred code alignment or zero if |
75 // the platform doesn't care. Guaranteed to be a power of two. | 75 // the platform doesn't care. Guaranteed to be a power of two. |
76 static word PreferredCodeAlignment(); | 76 static intptr_t PreferredCodeAlignment(); |
77 | |
78 // Returns the stack size limit. | |
79 static uword GetStackSizeLimit(); | |
80 | 77 |
81 // Returns true if StackFrameIterator can be used from an isolate that isn't | 78 // Returns true if StackFrameIterator can be used from an isolate that isn't |
82 // the calling thread's current isolate. | 79 // the calling thread's current isolate. |
83 static bool AllowStackFrameIteratorFromAnotherThread(); | 80 static bool AllowStackFrameIteratorFromAnotherThread(); |
84 | 81 |
85 // Returns number of available processor cores. | 82 // Returns number of available processor cores. |
86 static int NumberOfAvailableProcessors(); | 83 static int NumberOfAvailableProcessors(); |
87 | 84 |
88 // Sleep the currently executing thread for millis ms. | 85 // Sleep the currently executing thread for millis ms. |
89 static void Sleep(int64_t millis); | 86 static void Sleep(int64_t millis); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 static void Shutdown(); | 138 static void Shutdown(); |
142 | 139 |
143 static void Abort(); | 140 static void Abort(); |
144 | 141 |
145 static void Exit(int code); | 142 static void Exit(int code); |
146 }; | 143 }; |
147 | 144 |
148 } // namespace dart | 145 } // namespace dart |
149 | 146 |
150 #endif // VM_OS_H_ | 147 #endif // VM_OS_H_ |
OLD | NEW |