v8
8.4.371 (node 14.15.5)
V8 is Google's open source JavaScript engine
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
c
d
f
g
h
i
j
m
n
o
p
r
s
t
u
Variables
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
c
e
g
i
j
k
m
n
p
r
s
t
w
Enumerator
a
b
c
d
e
g
i
j
k
n
o
p
r
s
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
d
e
g
i
m
n
p
r
s
t
u
w
Enumerations
a
b
c
e
f
g
m
n
o
p
s
t
u
w
Enumerator
b
c
d
e
h
j
k
n
o
p
r
s
t
u
Related Functions
a
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Files
File List
Globals
All
c
m
s
u
v
Macros
c
m
s
u
v
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
heap.h
Go to the documentation of this file.
1
// Copyright 2020 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
INCLUDE_CPPGC_HEAP_H_
6
#
define
INCLUDE_CPPGC_HEAP_H_
7
8
#
include
<
memory
>
9
#
include
<
vector
>
10
11
#
include
"cppgc/common.h"
12
#
include
"cppgc/custom-space.h"
13
#
include
"v8config.h"
// NOLINT(build/include_directory)
14
15
namespace
cppgc
{
16
namespace
internal
{
17
class
Heap;
18
}
// namespace internal
19
20
class
V8_EXPORT
Heap
{
21
public
:
22
/**
23
* Specifies the stack state the embedder is in.
24
*/
25
using
StackState =
EmbedderStackState
;
26
27
struct
HeapOptions
{
28
static
HeapOptions
Default
() {
return
{}; }
29
30
/**
31
* Custom spaces added to heap are required to have indices forming a
32
* numbered sequence starting at 0, i.e., their kSpaceIndex must correspond
33
* to the index they reside in the vector.
34
*/
35
std::vector<std::unique_ptr<
CustomSpaceBase
>>
custom_spaces
;
36
};
37
38
static
std::unique_ptr<
Heap
>
Create
(
HeapOptions
=
HeapOptions
::
Default
(
)
);
39
40
virtual
~
Heap
() =
default
;
41
42
/**
43
* Forces garbage collection.
44
*
45
* \param source String specifying the source (or caller) triggering a
46
* forced garbage collection.
47
* \param reason String specifying the reason for the forced garbage
48
* collection.
49
* \param stack_state The embedder stack state, see StackState.
50
*/
51
void
ForceGarbageCollectionSlow
(
52
const
char
* source,
const
char
* reason,
53
StackState stack_state = StackState
::
kMayContainHeapPointers
);
54
55
private
:
56
Heap() =
default
;
57
58
friend
class
internal
::Heap;
59
};
60
61
}
// namespace cppgc
62
63
#
endif
// INCLUDE_CPPGC_HEAP_H_
include
cppgc
heap.h
Generated on Fri Oct 29 2021 20:07:23 for v8 by
1.9.1