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

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: 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_android.cc
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index a33effe8d2cf6449111576eee79d49a8470ad2f7..b3a5437b9f1565c379e2042775615c5c59a34367 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.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,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 = memalign(alignment, size);
+ if (p == NULL) {
+ UNREACHABLE();
+ return NULL;
cshapiro 2012/11/30 00:23:25 This return is not needed.
Cutch 2012/11/30 04:09:54 Done.
Cutch 2012/11/30 04:09:54 I was copying the structure of OS::GetCurrentTimeM
+ }
+ 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