Chromium Code Reviews| Index: runtime/vm/os_macos.cc |
| diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc |
| index 94470b508e9a50eeb46279c63318f9cea518817c..656b29ffeb6437b19a7840c23fc08aa357edeac7 100644 |
| --- a/runtime/vm/os_macos.cc |
| +++ b/runtime/vm/os_macos.cc |
| @@ -68,6 +68,26 @@ int64_t OS::GetCurrentTimeMicros() { |
| } |
| +void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) { |
| + const int kMinimumAlignment = 16; |
| + ASSERT(Utils::IsPowerOfTwo(alignment)); |
| + ASSERT(alignment >= kMinimumAlignment); |
| + void* p = NULL; |
| + int r; |
| + r = posix_memalign(&p, alignment, size); |
| + if (p == NULL) { |
| + UNREACHABLE(); |
| + return NULL; |
|
cshapiro
2012/11/30 00:23:25
ditto
Cutch
2012/11/30 04:09:54
Done.
|
| + } |
| + return p; |
| +} |
| + |
| + |
| +void OS::AlignedFree(void* ptr) { |
| + free(ptr); |
| +} |
| + |
| + |
| word OS::ActivationFrameAlignment() { |
| // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI |
| // Function Call Guide". |