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

Unified Diff: runtime/vm/os_test.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_test.cc
diff --git a/runtime/vm/os_test.cc b/runtime/vm/os_test.cc
index 499972e84526b51d6b07f4dbc26bee7b8012e9bc..7dd4bb8b3b8ba14f8d56ea762ab6f808bb5c5b48 100644
--- a/runtime/vm/os_test.cc
+++ b/runtime/vm/os_test.cc
@@ -54,4 +54,17 @@ UNIT_TEST_CASE(OsFuncs) {
EXPECT_LT(0U, OS::GetStackSizeLimit());
}
+
+UNIT_TEST_CASE(OSAlignedAllocate) {
+ void* p16 = OS::AlignedAllocate(1023, 16);
+ void* p32 = OS::AlignedAllocate(1025, 32);
+ void* p64 = OS::AlignedAllocate(1025, 64);
+ EXPECT((reinterpret_cast<intptr_t>(p16) & 15) == 0);
+ EXPECT((reinterpret_cast<intptr_t>(p32) & 31) == 0);
+ EXPECT((reinterpret_cast<intptr_t>(p64) & 63) == 0);
+ OS::AlignedFree(p16);
+ OS::AlignedFree(p32);
+ OS::AlignedFree(p64);
+}
+
} // namespace dart
« runtime/vm/os.h ('K') | « runtime/vm/os_macos.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698