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

Unified Diff: runtime/vm/os_android.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
Index: runtime/vm/os_android.cc
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index a33effe8d2cf6449111576eee79d49a8470ad2f7..b3b661fa0ab234c77010c8d79c0babe1c6569504 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -10,6 +10,7 @@
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <malloc.h>
cshapiro 2012/11/29 21:28:17 This should be kept sorted. Move it to line 9.
Cutch 2012/11/29 23:53:17 Done.
#include <unistd.h>
#include "platform/utils.h"
@@ -67,6 +68,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 = memalign(alignment, size);
cshapiro 2012/11/29 21:28:17 I would follow the example of gettimeofday on line
Cutch 2012/11/29 23:53:17 Done.
+ ASSERT(p != NULL);
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698