v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
raw-heap.cc
Go to the documentation of this file.
1// Copyright 2020 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
6
8
9namespace cppgc {
10namespace internal {
11
12// static
13constexpr size_t RawHeap::kNumberOfRegularSpaces;
14
17 const std::vector<std::unique_ptr<CustomSpaceBase>>& custom_spaces)
18 : main_heap_(heap) {
19 size_t i = 0;
20 for (; i < static_cast<size_t>(RegularSpaceType::kLarge); ++i) {
21 spaces_.push_back(std::make_unique<NormalPageSpace>(this, i, false));
22 }
23 spaces_.push_back(std::make_unique<LargePageSpace>(
24 this, static_cast<size_t>(RegularSpaceType::kLarge)));
26 for (size_t j = 0; j < custom_spaces.size(); j++) {
27 spaces_.push_back(std::make_unique<NormalPageSpace>(
28 this, kNumberOfRegularSpaces + j, custom_spaces[j]->IsCompactable()));
29 }
30}
31
32RawHeap::~RawHeap() = default;
33
34} // namespace internal
35} // namespace cppgc
RawHeap(HeapBase *heap, const std::vector< std::unique_ptr< CustomSpaceBase > > &custom_spaces)
Definition raw-heap.cc:15
static constexpr size_t kNumberOfRegularSpaces
Definition raw-heap.h:43
#define DCHECK_EQ(v1, v2)
Definition logging.h:485