summaryrefslogtreecommitdiff
path: root/deps/v8/test/benchmarks/cpp/cppgc/benchmark_utils.cc
blob: 87fb26bbb7050db9d5662a05ac6605ff46396c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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