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

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: os.h fix 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..72604dc42eef0284b216d2c5b2a67f5b9484a90a 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,23 @@ 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 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.
« runtime/vm/os.h ('K') | « runtime/vm/os_test.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698