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

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: 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_test.cc
diff --git a/runtime/vm/os_test.cc b/runtime/vm/os_test.cc
index 499972e84526b51d6b07f4dbc26bee7b8012e9bc..339e0ee73cac5aa6fa2a352e0b1f17bc43f93c02 100644
--- a/runtime/vm/os_test.cc
+++ b/runtime/vm/os_test.cc
@@ -54,4 +54,16 @@ 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

Powered by Google App Engine
This is Rietveld 408576698