v8
8.6.395 (node 15.0.1)
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
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
a
c
s
v
Macros
a
c
s
v
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
custom-space.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_CUSTOM_SPACE_H_
6
#
define
INCLUDE_CPPGC_CUSTOM_SPACE_H_
7
8
#
include
<
stddef
.
h
>
9
10
namespace
cppgc
{
11
12
struct
CustomSpaceIndex
{
13
CustomSpaceIndex
(size_t value) :
value
(value) {}
// NOLINT
14
size_t
value
;
15
};
16
17
/**
18
* Top-level base class for custom spaces. Users must inherit from CustomSpace
19
* below.
20
*/
21
class
CustomSpaceBase
{
22
public
:
23
virtual
~
CustomSpaceBase
() =
default
;
24
virtual
CustomSpaceIndex
GetCustomSpaceIndex
()
const
= 0;
25
};
26
27
/**
28
* Base class custom spaces should directly inherit from. The class inheriting
29
* from CustomSpace must define kSpaceIndex as unique space index. These
30
* indices need for form a sequence starting at 0.
31
*
32
* Example:
33
* \code
34
* class CustomSpace1 : public CustomSpace<CustomSpace1> {
35
* public:
36
* static constexpr CustomSpaceIndex kSpaceIndex = 0;
37
* };
38
* class CustomSpace2 : public CustomSpace<CustomSpace2> {
39
* public:
40
* static constexpr CustomSpaceIndex kSpaceIndex = 1;
41
* };
42
* \endcode
43
*/
44
template
<
typename
ConcreteCustomSpace>
45
class
CustomSpace
:
public
CustomSpaceBase
{
46
public
:
47
CustomSpaceIndex
GetCustomSpaceIndex
()
const
final
{
48
return
ConcreteCustomSpace::kSpaceIndex;
49
}
50
};
51
52
/**
53
* User-overridable trait that allows pinning types to custom spaces.
54
*/
55
template
<
typename
T,
typename
=
void
>
56
struct
SpaceTrait
{
57
using
Space =
void
;
58
};
59
60
}
// namespace cppgc
61
62
#
endif
// INCLUDE_CPPGC_CUSTOM_SPACE_H_
include
cppgc
custom-space.h
Generated on Fri Oct 29 2021 20:08:04 for v8 by
1.9.1