// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/heap/cppgc/raw-heap.h" #include "src/heap/cppgc/heap-space.h" namespace cppgc { namespace internal { // static constexpr size_t RawHeap::kNumberOfRegularSpaces; RawHeap::RawHeap( HeapBase* heap, const std::vector>& custom_spaces) : main_heap_(heap) { size_t i = 0; for (; i < static_cast(RegularSpaceType::kLarge); ++i) { spaces_.push_back(std::make_unique(this, i, false)); } spaces_.push_back(std::make_unique( this, static_cast(RegularSpaceType::kLarge))); DCHECK_EQ(kNumberOfRegularSpaces, spaces_.size()); for (size_t j = 0; j < custom_spaces.size(); j++) { spaces_.push_back(std::make_unique( this, kNumberOfRegularSpaces + j, custom_spaces[j]->IsCompactable())); } } RawHeap::~RawHeap() = default; } // namespace internal } // namespace cppgc