v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1
// Copyright 2021 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
5
#ifndef V8_HEAP_CPPGC_PLATFORM_H_
6
#define V8_HEAP_CPPGC_PLATFORM_H_
7
8
#include <string>
9
10
#include "
include/cppgc/platform.h
"
11
#include "
include/cppgc/source-location.h
"
12
#include "
src/base/macros.h
"
13
14
namespace
cppgc::internal
{
15
16
class
HeapBase;
17
18
class
V8_EXPORT_PRIVATE
FatalOutOfMemoryHandler
final {
19
public
:
20
using
Callback
= void(
const
std::string&,
const
SourceLocation
&,
HeapBase
*);
21
22
FatalOutOfMemoryHandler
() =
default
;
23
explicit
FatalOutOfMemoryHandler
(
HeapBase
*
heap
) :
heap_
(
heap
) {}
24
25
[[noreturn]]
void
operator()(
26
const
std::string& reason = std::string(),
27
const
SourceLocation
& = SourceLocation::Current())
const
;
28
29
void
SetCustomHandler(Callback*);
30
31
// Disallow copy/move.
32
FatalOutOfMemoryHandler
(
const
FatalOutOfMemoryHandler
&) =
delete
;
33
FatalOutOfMemoryHandler
&
operator=
(
const
FatalOutOfMemoryHandler
&) =
delete
;
34
35
private
:
36
HeapBase
*
heap_
=
nullptr
;
37
Callback
* custom_handler_ =
nullptr
;
38
};
39
40
// Gets the global OOM handler that is not bound to any specific Heap instance.
41
FatalOutOfMemoryHandler
&
GetGlobalOOMHandler
();
42
43
// Gets the gobal PageAllocator that is not bound to any specific Heap instance.
44
PageAllocator
&
GetGlobalPageAllocator
();
45
46
}
// namespace cppgc::internal
47
48
#endif
// V8_HEAP_CPPGC_PLATFORM_H_
cppgc::internal::FatalOutOfMemoryHandler
Definition
platform.h:18
cppgc::internal::FatalOutOfMemoryHandler::FatalOutOfMemoryHandler
FatalOutOfMemoryHandler(const FatalOutOfMemoryHandler &)=delete
cppgc::internal::FatalOutOfMemoryHandler::FatalOutOfMemoryHandler
FatalOutOfMemoryHandler(HeapBase *heap)
Definition
platform.h:23
cppgc::internal::FatalOutOfMemoryHandler::FatalOutOfMemoryHandler
FatalOutOfMemoryHandler()=default
cppgc::internal::FatalOutOfMemoryHandler::operator=
FatalOutOfMemoryHandler & operator=(const FatalOutOfMemoryHandler &)=delete
cppgc::internal::FatalOutOfMemoryHandler::Callback
void(const std::string &, const SourceLocation &, HeapBase *) Callback
Definition
platform.h:20
cppgc::internal::HeapBase
Definition
heap-base.h:82
v8::PageAllocator
Definition
v8-platform.h:455
v8::SourceLocation
Definition
v8-source-location.h:31
platform.h
cppgc::internal
Definition
cross-heap-remembered-set.h:14
cppgc::internal::GetGlobalPageAllocator
PageAllocator & GetGlobalPageAllocator()
Definition
platform.cc:78
cppgc::internal::GetGlobalOOMHandler
FatalOutOfMemoryHandler & GetGlobalOOMHandler()
Definition
platform.cc:73
heap
Definition
platform.h:72
source-location.h
macros.h
V8_EXPORT_PRIVATE
#define V8_EXPORT_PRIVATE
Definition
macros.h:460
heap_
Heap * heap_
Definition
traced-handles.cc:476
src
heap
cppgc
platform.h
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0