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

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: Add tests 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
« runtime/vm/os_linux.cc ('K') | « runtime/vm/os_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« runtime/vm/os_linux.cc ('K') | « runtime/vm/os_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698