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..889bd5f118a31da99481eea2221aa63ddfe68ff0 100644 |
| --- a/runtime/vm/os_win.cc |
| +++ b/runtime/vm/os_win.cc |
| @@ -5,6 +5,7 @@ |
| #include "vm/os.h" |
| #include <time.h> |
| +#include <malloc.h> |
|
cshapiro
2012/11/29 21:28:17
move to line 7
Cutch
2012/11/29 23:53:17
Done.
|
| #include "platform/assert.h" |
| @@ -102,6 +103,21 @@ 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); |
| + ASSERT(p != NULL); |
| + 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. |