blob: d56ab2f648d35f1d84cb2351636ddf2757f296c7 [file] [log] [blame]
Michael Lippautzca279472021-04-23 16:13:52 +00001// Copyright 2021 The Chromium 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 "gin/public/cppgc.h"
6#include "gin/public/v8_platform.h"
7#include "v8/include/cppgc/platform.h"
8
9namespace gin {
10
11void InitializeCppgcFromV8Platform() {
12 static bool cppgc_is_initialized = false;
13 if (cppgc_is_initialized)
14 return;
15
16 cppgc::InitializeProcess(gin::V8Platform::Get()->GetPageAllocator());
17
18 cppgc_is_initialized = true;
19}
20
21} // namespace gin