5 #ifndef INCLUDE_CPPGC_INTERNAL_GC_INFO_H_
6 #define INCLUDE_CPPGC_INTERNAL_GC_INFO_H_
10 #include <type_traits>
12 #include "cppgc/internal/finalizer-trait.h"
13 #include "cppgc/internal/name-trait.h"
14 #include "cppgc/trace-trait.h"
20 using GCInfoIndex = uint16_t;
26 FinalizationCallback, TraceCallback, NameCallback,
bool);
31 template <
typename T,
typename ParentMostGarbageCollectedType>
34 std::has_virtual_destructor<ParentMostGarbageCollectedType>::value;
36 std::is_trivially_destructible<ParentMostGarbageCollectedType>::value &&
37 std::is_trivially_destructible<T>::value;
40 ParentMostGarbageCollectedType>::value;
41 #ifdef CPPGC_SUPPORTS_OBJECT_NAMES
53 ParentMostGarbageCollectedType, T>;
59 struct GCInfoTrait final {
61 static_assert(
sizeof(T),
"T must be fully defined");
62 static std::atomic<GCInfoIndex>
64 const GCInfoIndex index = registered_index.load(std::memory_order_acquire);
69 std::is_polymorphic<T>::value);