Chromium Code Reviews| Index: runtime/vm/os_win.cc |
| diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc |
| index 6f3f4c436f05ff3fedd00cad9e270e1857481ccf..2c21e688f6a34ec92f9f5ce827ef9f795f3e17dd 100644 |
| --- a/runtime/vm/os_win.cc |
| +++ b/runtime/vm/os_win.cc |
| @@ -4,6 +4,7 @@ |
| #include "vm/os.h" |
| +#include <malloc.h> |
| #include <time.h> |
| #include "platform/assert.h" |
| @@ -102,6 +103,24 @@ 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 = _aligned_malloc(size, alignment); |
| + 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) { |
| + _aligned_free(ptr); |
| +} |
| + |
| + |
| word OS::ActivationFrameAlignment() { |
| #ifdef _WIN64 |
| // Windows 64-bit ABI requires the stack to be 16-byte aligned. |