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

Unified Diff: runtime/vm/os_linux.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_linux.cc
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index a33effe8d2cf6449111576eee79d49a8470ad2f7..c7bfcbcce6f185f1725687776eef9616b7109715 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -6,6 +6,7 @@
#include <errno.h>
#include <limits.h>
+#include <malloc.h>
#include <time.h>
#include <sys/resource.h>
#include <sys/time.h>
@@ -67,6 +68,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 = memalign(alignment, size);
+ if (p == NULL) {
+ UNREACHABLE();
+ }
+ return p;
+}
+
+
+void OS::AlignedFree(void* ptr) {
+ free(ptr);
+}
+
+
// TODO(5411554): May need to hoist these architecture dependent code
// into a architecture specific file e.g: os_ia32_linux.cc
word OS::ActivationFrameAlignment() {
« runtime/vm/os.h ('K') | « runtime/vm/os_android.cc ('k') | runtime/vm/os_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698