v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
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::internal::ConditionalStackAllocatedBase< T >::CPPGC_STACK_ALLOCATED
CPPGC_STACK_ALLOCATED()
cppgc::internal::ConditionalStackAllocatedBase
Definition
conditional-stack-allocated.h:19
cppgc::IsStackAllocatedType
Definition
macros.h:51
cppgc::internal::RequiresStackAllocated
Definition
conditional-stack-allocated.h:22
macros.h
cppgc::internal::IsTraceableV
constexpr bool IsTraceableV
Definition
type-traits.h:59
cppgc
Definition
cross-heap-remembered-set.h:14
cppgc::IsGarbageCollectedOrMixinTypeV
constexpr bool IsGarbageCollectedOrMixinTypeV
Definition
type-traits.h:215
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
type-traits.h
include
cppgc
internal
conditional-stack-allocated.h
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0