Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/zone/zone.h"
6 :
7 : #include "src/zone/accounting-allocator.h"
8 : #include "testing/gtest/include/gtest/gtest.h"
9 :
10 : namespace v8 {
11 : namespace internal {
12 :
13 15418 : TEST(Zone, 8ByteAlignment) {
14 2 : AccountingAllocator allocator;
15 2 : Zone zone(&allocator, ZONE_NAME);
16 :
17 33 : for (size_t i = 0; i < 16; ++i) {
18 32 : ASSERT_EQ(reinterpret_cast<intptr_t>(zone.New(i)) % 8, 0);
19 : }
20 : }
21 :
22 : } // namespace internal
23 9249 : } // namespace v8
|