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

Side by Side Diff: runtime/vm/os_test.cc

Issue 2276803002: Remove unused external typed data factories. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/os_macos.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "platform/utils.h" 6 #include "platform/utils.h"
7 #include "vm/globals.h" 7 #include "vm/globals.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 48
49 UNIT_TEST_CASE(OsFuncs) { 49 UNIT_TEST_CASE(OsFuncs) {
50 EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment())); 50 EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment()));
51 EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment())); 51 EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment()));
52 int procs = OS::NumberOfAvailableProcessors(); 52 int procs = OS::NumberOfAvailableProcessors();
53 EXPECT_LE(1, procs); 53 EXPECT_LE(1, procs);
54 } 54 }
55 55
56
57 UNIT_TEST_CASE(OSAlignedAllocate) {
58 // TODO(johnmccutchan): Test other alignments, once we support
59 // alignments != 16 on Mac.
60 void* p1 = OS::AlignedAllocate(1023, 16);
61 void* p2 = OS::AlignedAllocate(1025, 16);
62 void* p3 = OS::AlignedAllocate(1025, 16);
63 void* p4 = OS::AlignedAllocate(1, 16);
64 void* p5 = OS::AlignedAllocate(2, 16);
65 void* p6 = OS::AlignedAllocate(4, 16);
66 EXPECT((reinterpret_cast<intptr_t>(p1) & 15) == 0);
67 EXPECT((reinterpret_cast<intptr_t>(p2) & 15) == 0);
68 EXPECT((reinterpret_cast<intptr_t>(p3) & 15) == 0);
69 EXPECT((reinterpret_cast<intptr_t>(p4) & 15) == 0);
70 EXPECT((reinterpret_cast<intptr_t>(p5) & 15) == 0);
71 EXPECT((reinterpret_cast<intptr_t>(p6) & 15) == 0);
72 OS::AlignedFree(p1);
73 OS::AlignedFree(p2);
74 OS::AlignedFree(p3);
75 OS::AlignedFree(p4);
76 OS::AlignedFree(p5);
77 OS::AlignedFree(p6);
78 }
79
80 } // namespace dart 56 } // namespace dart
OLDNEW
« no previous file with comments | « 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