Otherwise, DCHECKs complain that the PageAllocator used for the GlobalGCInfoTable may differ when setting up the platform repeatedly through benchmarking SetUp(). Change-Id: I7e87e8c9d8c283105e1bd75a4cd176df7f304315 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283075 Reviewed-by: Omer Katz <omerkatz@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#77920}
32 lines
806 B
C++
32 lines
806 B
C++
// Copyright 2021 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 "test/benchmarks/cpp/cppgc/benchmark_utils.h"
|
|
|
|
#include "include/cppgc/platform.h"
|
|
#include "test/unittests/heap/cppgc/test-platform.h"
|
|
|
|
namespace cppgc {
|
|
namespace internal {
|
|
namespace testing {
|
|
|
|
// static
|
|
std::shared_ptr<testing::TestPlatform> BenchmarkWithHeap::platform_;
|
|
|
|
// static
|
|
void BenchmarkWithHeap::InitializeProcess() {
|
|
platform_ = std::make_shared<testing::TestPlatform>();
|
|
cppgc::InitializeProcess(platform_->GetPageAllocator());
|
|
}
|
|
|
|
// static
|
|
void BenchmarkWithHeap::ShutdownProcess() {
|
|
cppgc::ShutdownProcess();
|
|
platform_.reset();
|
|
}
|
|
|
|
} // namespace testing
|
|
} // namespace internal
|
|
} // namespace cppgc
|