v8
14.1.146 (node 25.0.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
conditional-stack-allocated.h
Go to the documentation of this file.
1
// Copyright 2025 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_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
6
#
define
INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
7
8
#
include
<
type_traits
>
9
10
#
include
"cppgc/macros.h"
// NOLINT(build/include_directory)
11
#
include
"cppgc/type-traits.h"
// NOLINT(build/include_directory)
12
13
namespace
cppgc
{
14
namespace
internal
{
15
16
// Base class that is marked as stack allocated if T is either marked as stack
17
// allocated or a traceable type.
18
template
<
typename
T>
19
class
ConditionalStackAllocatedBase;
20
21
template
<
typename
T>
22
concept RequiresStackAllocated =
23
!
std
::
is_void_v
<
T
> &&
24
(
cppgc
::
IsStackAllocatedType
<
T
> ||
cppgc
::
internal
::
IsTraceableV
<
T
> ||
25
cppgc
::
IsGarbageCollectedOrMixinTypeV
<
T
>);
26
27
template
<
typename
T>
28
requires(
RequiresStackAllocated
<
T
>)
29
class
ConditionalStackAllocatedBase
<
T
> {
30
public
:
31
CPPGC_STACK_ALLOCATED
();
32
};
33
34
template
<
typename
T>
35
requires(!
RequiresStackAllocated
<
T
>)
36
class
ConditionalStackAllocatedBase
<
T
> {};
37
38
}
// namespace internal
39
}
// namespace cppgc
40
41
#
endif
// INCLUDE_CPPGC_INTERNAL_CONDITIONAL_STACK_ALLOCATED_H_
CPPGC_STACK_ALLOCATED
#define CPPGC_STACK_ALLOCATED()
Definition
macros.h:44
cppgc::internal
Definition
allocation.h:45
cppgc
Definition
allocation.h:38
include
cppgc
internal
conditional-stack-allocated.h
Generated on Thu Oct 30 2025 09:26:59 for v8 by
1.9.8