Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Unified Diff: runtime/vm/os_win.cc

Issue 11414211: Expose transferable constructor to Int8List (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698