UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::GC Namespace Reference

Namespaces

namespace  Private
 
namespace  Test
 

Classes

struct  FAROBlock
 
class  FAROQueue
 
class  FAROQueueStore
 
class  FBatcherBase
 
class  FBoundedWorkstealingQueue
 
class  FContextPool
 
class  FContextPoolScope
 
struct  FDebugSchemaStackNode
 
struct  FDebugSchemaStackNoOpScope
 
struct  FDebugSchemaStackScope
 
struct  FDetailedClassStats
 
struct  FImmutableReference
 
struct  FInstanceStats
 
struct  FMemberDeclaration
 
class  FMemberId
 
struct  FMemberInfo
 
struct  FMemberPacked
 
union  FMemberWord
 
struct  FMutableReference
 
class  FPageAllocator
 
class  FPrefetchingObjectIterator
 
struct  FProcessorStats
 
class  FPropertyStack
 
class  FPropertyStackScope
 
class  FReachabilityAnalysisState
 
class  FRealtimeGC
 
struct  FReferenceArray
 
struct  FReferenceMetadata
 
struct  FResolvedMutableReference
 
class  FSchemaBuilder
 
struct  FSchemaHeader
 
class  FSchemaOwner
 
struct  FSchemaPacker
 
struct  FSchemaStats
 
class  FSchemaView
 
struct  FSlowARO
 
class  FSlowAROManager
 
struct  FSparseStructArray
 
struct  FStridedLayout
 
struct  FStructArray
 
struct  FStructArrayBlock
 
struct  FStructArrayWithoutStride
 
class  FStructBatcher
 
class  FStructBlockifier
 
struct  FStructMemberStats
 
struct  FSuspendedStructBatch
 
class  FTimeSlicer
 
union  FUnreachableObject
 
class  FWeakReferenceEliminator
 
struct  FWeakReferenceInfo
 
struct  FWorkBlock
 
class  FWorkBlockifier
 
class  FWorkCoordinator
 UE_BUILD_SHIPPING. More...
 
struct  FWorkerContext
 
class  FWorkerIndexAllocator
 
struct  FWorkstealingManager
 
class  FWorkstealingQueue
 
struct  TAddAdapter
 
struct  TBatchDispatcher
 
class  TDebugReachabilityCollector
 
class  TDebugReachabilityProcessor
 
class  TDefaultCollector
 
struct  TDefaultPayloadOps
 
struct  TDirectDispatcher
 
class  TFastReferenceCollector
 
struct  TGatherIterator
 
struct  TGetDispatcherType
 
struct  TMemberDeclaration
 
class  TReachabilityCollector
 
class  TReachabilityCollectorBase
 
class  TReachabilityProcessor
 
class  TReferenceBatcher
 
class  TSchemaBuilder
 
class  TSingleton
 
class  TThreadedGather
 

Typedefs

using FStridedReferenceArray = Private::FStridedReferenceArray
 
using FStridedReferenceView = Private::FStridedReferenceView
 
using FLog2Distribution = uint32[32]
 
using FTokenId = FMemberId
 
using ETokenlessId = EMemberlessId
 
using ObjectAROFn = void(*)(UObject *, FReferenceCollector &)
 
using StructAROFn = void(*)(void *, FReferenceCollector &)
 

Enumerations

enum class  EKillable { No , Yes }
 
enum class  EDumpUnit { Bytes , Number }
 
enum class  EGatherOptions : uint32 { None = 0 , Parallel = 1 }
 
enum class  ELoot { Nothing , Block , ARO , Context }
 
enum class  EAROFlags { None = 0 , Unbalanced = 1 << 0 , ExtraSlow = 2 << 0 }
 
enum class  EMemberType : uint8 {
  Stop , Jump , Reference , ReferenceArray ,
  StructArray , StridedArray , StructSet , FieldPath ,
  FieldPathArray , FreezableReferenceArray , FreezableStructArray , Optional ,
  DynamicallyTypedValue , ARO , SlowARO , MemberARO ,
  Count
}
 
enum class  EOrigin : uint8 { Other , Blueprint }
 
enum class  EMemberlessId {
  Collector = 1 , Class , Outer , ExternalPackage ,
  ClassOuter , InitialReference , Max = InitialReference
}
 

Functions

void MarkAsReachable (const UObject *Obj)
 
EGCOptions GetReferenceCollectorOptions (bool bPerformFullPurge)
 
EGatherOptions GetObjectGatherOptions ()
 
int32 GetNumSlowAROs ()
 
FORCEINLINE UObjectGetObject (FImmutableReference In)
 
FORCEINLINE UObjectGetObject (FMutableReference In)
 
FORCEINLINE void PrefetchObjectPointer (FImmutableReference)
 
FORCEINLINE void PrefetchObjectPointer (FMutableReference In)
 
FORCEINLINE FImmutableReference ToImmutableReference (FMutableReference In)
 
FORCEINLINE FImmutableReference ToResolvedReference (FImmutableReference In)
 
FORCEINLINE FResolvedMutableReference ToResolvedReference (FMutableReference In)
 
template<class RefType >
RefType ToReference (FMutableReference In)
 
template<>
FORCEINLINE FImmutableReference ToReference (FMutableReference In)
 
template<>
FORCEINLINE FMutableReference ToReference (FMutableReference In)
 
template<class RefType >
RefType MakeReference (UObject *&Object)
 
template<>
FORCEINLINE FImmutableReference MakeReference (UObject *&Object)
 
template<>
FORCEINLINE FMutableReference MakeReference (UObject *&Object)
 
FORCEINLINE_DEBUGGABLE void CheckValid (FSchemaView Schema)
 
void PadObjectArray (TArray< UObject * > &Objects)
 
FORCEINLINE_DEBUGGABLE void PadBlock (FWorkBlock &Block)
 
void RegisterSlowImplementation (ObjectAROFn ARO, EAROFlags Flags)
 
int32 FindSlowImplementation (ObjectAROFn ARO)
 
FORCEINLINE_DEBUGGABLE void KillReference (UObject *&Object)
 
template<EGCOptions Options>
constexpr FORCEINLINE EKillable MayKill (EOrigin Origin, bool bAllowKill)
 
template<bool bPerformFullPurge>
FORCENOINLINE void CollectGarbageImpl (EObjectFlags KeepFlags)
 
FORCEINLINE void CollectGarbageInternal (EObjectFlags KeepFlags, bool bPerformFullPurge)
 
template<bool bPerformFullPurge>
void PreCollectGarbageImpl (EObjectFlags KeepFlags)
 
template<bool bPerformFullPurge>
void CollectGarbageImpl (EObjectFlags KeepFlags)
 
template<bool bPerformFullPurge>
void PostCollectGarbageImpl (EObjectFlags KeepFlags)
 
void SuspendWork (FWorkerContext &Context)
 
ELoot StealWork (FWorkerContext &Context, FReferenceCollector &Collector, FWorkBlock *&OutBlock, EGCOptions Options)
 
TArrayView< FWorkerContext * > InitializeAsyncProcessingContexts (FWorkerContext &InContext)
 
void ReleaseAsyncProcessingContexts (FWorkerContext &InContext, TArrayView< FWorkerContext * > Contexts)
 
void ProcessAsync (void(*ProcessSync)(void *, FWorkerContext &), void *Processor, FWorkerContext &InContext)
 
FName ToName (EMemberType Type)
 
template<typename Fn >
void VisitInnerSchemas (FSchemaView Schema, Fn Visitor)
 
FMemberInfo GetMemberDebugInfo (FSchemaView Schema, FMemberId Id)
 
void DeclareIntrinsicSchema (UClass *Class, FSchemaView Schema)
 
FSchemaView GetIntrinsicSchema (UClass *Class)
 
void DumpSchemaStats (FOutputDevice &Out)
 
uint32 CountSchemas (uint32 &OutNumWords)
 
 ENUM_CLASS_FLAGS (EGatherOptions)
 
int32 GetNumThreadsForGather (const EGatherOptions Options, const int32 NumObjects)
 
template<class CollectorType , class ProcessorType >
TDirectDispatcher< ProcessorType > GetDispatcher (CollectorType &Collector, ProcessorType &Processor, FWorkerContext &Context)
 
 ENUM_CLASS_FLAGS (EAROFlags)
 
COREUOBJECT_API TSAN_ATOMIC (bool) GIsIncrementalReachabilityPending
 
FMemberWord ToWord (FSchemaView In)
 
FMemberWord ToWord (StructAROFn In)
 
FName ToName (const char *Name)
 
FName ToName (FPropertyStack &Stack)
 
template<typename NameType >
FMemberDeclaration DeclareMember (NameType &&Name, uint32 Offset, EMemberType Type)
 
template<typename NameType , typename ExtraWordType >
FMemberDeclaration DeclareMember (NameType &&Name, uint32 Offset, EMemberType Type, ExtraWordType Extra)
 
template<class T >
void DeclareIntrinsicMembers (UClass *Class, std::initializer_list< TMemberDeclaration< T > > Members)
 

Variables

constexpr FStringView UnknownGCObjectName = TEXTVIEW("Unknown FGCObject")
 
EInternalObjectFlags GReachableObjectFlag = EInternalObjectFlags::ReachabilityFlag0
 
EInternalObjectFlags GUnreachableObjectFlag = EInternalObjectFlags::Unreachable
 
EInternalObjectFlags GMaybeUnreachableObjectFlag = EInternalObjectFlags::ReachabilityFlag2
 
bool GIsIncrementalReachabilityPending = false
 
FReachabilityAnalysisState GReachabilityState
 
TMap< UClass *, FSchemaOwnerGIntrinsicClassSchemas
 
constexpr EGCOptions DefaultOptions = EGCOptions::AutogenerateSchemas
 

Typedef Documentation

◆ ETokenlessId

◆ FLog2Distribution

◆ FStridedReferenceArray

◆ FStridedReferenceView

◆ FTokenId

◆ ObjectAROFn

◆ StructAROFn

Enumeration Type Documentation

◆ EAROFlags

enum class UE::GC::EAROFlags
strong
Enumerator
None 
Unbalanced 
ExtraSlow 

◆ EDumpUnit

enum class UE::GC::EDumpUnit
strong
Enumerator
Bytes 
Number 

◆ EGatherOptions

Settings for GatherUnreachableObjects function

Enumerator
None 
Parallel 

◆ EKillable

enum class UE::GC::EKillable
strong
Enumerator
No 
Yes 

◆ ELoot

enum class UE::GC::ELoot
strong
Enumerator
Nothing 
Block 
ARO 
Context 

◆ EMemberlessId

Enumerator
Collector 
Class 
Outer 
ExternalPackage 
ClassOuter 
InitialReference 
Max 

◆ EMemberType

enum class UE::GC::EMemberType : uint8
strong

Describes member variable types, AddReferencedObject calls and stop/jump instructions used by VisitMembers

Enumerator
Stop 
Jump 
Reference 
ReferenceArray 
StructArray 
StridedArray 
StructSet 
FieldPath 
FieldPathArray 
FreezableReferenceArray 
FreezableStructArray 
Optional 
DynamicallyTypedValue 
ARO 
SlowARO 
MemberARO 
Count 

◆ EOrigin

enum class UE::GC::EOrigin : uint8
strong

Declares if a schema represents a blueprint generated type

Enumerator
Other 
Blueprint 

Function Documentation

◆ CheckValid()

FORCEINLINE_DEBUGGABLE void UE::GC::CheckValid ( FSchemaView  Schema)

◆ CollectGarbageImpl() [1/2]

template<bool bPerformFullPurge>
FORCENOINLINE void UE::GC::CollectGarbageImpl ( EObjectFlags  KeepFlags)

◆ CollectGarbageImpl() [2/2]

template<bool bPerformFullPurge>
void UE::GC::CollectGarbageImpl ( EObjectFlags  KeepFlags)

◆ CollectGarbageInternal()

FORCEINLINE void UE::GC::CollectGarbageInternal ( EObjectFlags  KeepFlags,
bool  bPerformFullPurge 
)

◆ CountSchemas()

uint32 UE::GC::CountSchemas ( uint32 OutNumWords)

◆ DeclareIntrinsicMembers()

template<class T >
void UE::GC::DeclareIntrinsicMembers ( UClass Class,
std::initializer_list< TMemberDeclaration< T > >  Members 
)

◆ DeclareIntrinsicSchema()

COREUOBJECT_API void UE::GC::DeclareIntrinsicSchema ( UClass Class,
FSchemaView  Schema 
)

◆ DeclareMember() [1/2]

template<typename NameType >
FMemberDeclaration UE::GC::DeclareMember ( NameType &&  Name,
uint32  Offset,
EMemberType  Type 
)

◆ DeclareMember() [2/2]

FMemberDeclaration UE::GC::DeclareMember ( NameType &&  Name,
uint32  Offset,
EMemberType  Type,
ExtraWordType  Extra 
)

◆ DumpSchemaStats()

void UE::GC::DumpSchemaStats ( FOutputDevice Out)

◆ ENUM_CLASS_FLAGS() [1/2]

UE::GC::ENUM_CLASS_FLAGS ( EAROFlags  )

◆ ENUM_CLASS_FLAGS() [2/2]

UE::GC::ENUM_CLASS_FLAGS ( EGatherOptions  )

◆ FindSlowImplementation()

int32 UE::GC::FindSlowImplementation ( ObjectAROFn  ARO)

◆ GetDispatcher()

template<class CollectorType , class ProcessorType >
TDirectDispatcher< ProcessorType > UE::GC::GetDispatcher ( CollectorType Collector,
ProcessorType &  Processor,
FWorkerContext Context 
)

◆ GetIntrinsicSchema()

FSchemaView UE::GC::GetIntrinsicSchema ( UClass Class)

◆ GetMemberDebugInfo()

COREUOBJECT_API FMemberInfo UE::GC::GetMemberDebugInfo ( FSchemaView  Schema,
FMemberId  Id 
)

◆ GetNumSlowAROs()

int32 UE::GC::GetNumSlowAROs ( )

◆ GetNumThreadsForGather()

int32 UE::GC::GetNumThreadsForGather ( const EGatherOptions  Options,
const int32  NumObjects 
)
inline

◆ GetObject() [1/2]

FORCEINLINE UObject * UE::GC::GetObject ( FImmutableReference  In)

◆ GetObject() [2/2]

FORCEINLINE UObject * UE::GC::GetObject ( FMutableReference  In)

◆ GetObjectGatherOptions()

EGatherOptions UE::GC::GetObjectGatherOptions ( )

◆ GetReferenceCollectorOptions()

EGCOptions UE::GC::GetReferenceCollectorOptions ( bool  bPerformFullPurge)

◆ InitializeAsyncProcessingContexts()

TArrayView< FWorkerContext * > UE::GC::InitializeAsyncProcessingContexts ( FWorkerContext InContext)

◆ KillReference()

FORCEINLINE_DEBUGGABLE void UE::GC::KillReference ( UObject *&  Object)

◆ MakeReference() [1/3]

template<class RefType >
RefType UE::GC::MakeReference ( UObject *&  Object)

◆ MakeReference() [2/3]

template<>
FORCEINLINE FImmutableReference UE::GC::MakeReference ( UObject *&  Object)

◆ MakeReference() [3/3]

template<>
FORCEINLINE FMutableReference UE::GC::MakeReference ( UObject *&  Object)

◆ MarkAsReachable()

COREUOBJECT_API void UE::GC::MarkAsReachable ( const UObject Obj)

Marks the object as Reachable if it's currently marked as MaybeUnreachable by incremental GC.

◆ MayKill()

template<EGCOptions Options>
constexpr FORCEINLINE EKillable UE::GC::MayKill ( EOrigin  Origin,
bool  bAllowKill 
)
constexpr

◆ PadBlock()

FORCEINLINE_DEBUGGABLE void UE::GC::PadBlock ( FWorkBlock Block)

◆ PadObjectArray()

COREUOBJECT_API void UE::GC::PadObjectArray ( TArray< UObject * > &  Objects)

◆ PostCollectGarbageImpl()

template<bool bPerformFullPurge>
void UE::GC::PostCollectGarbageImpl ( EObjectFlags  KeepFlags)

bUseTimeLimit =

◆ PreCollectGarbageImpl()

template<bool bPerformFullPurge>
void UE::GC::PreCollectGarbageImpl ( EObjectFlags  KeepFlags)

Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set

Parameters
KeepFlagsobjects with those flags will be kept regardless of being referenced or not
bPerformFullPurgeif true, perform a full purge after the mark pass

◆ PrefetchObjectPointer() [1/2]

FORCEINLINE void UE::GC::PrefetchObjectPointer ( FImmutableReference  )

◆ PrefetchObjectPointer() [2/2]

FORCEINLINE void UE::GC::PrefetchObjectPointer ( FMutableReference  In)

◆ ProcessAsync()

COREUOBJECT_API void UE::GC::ProcessAsync ( void(*)(void *, FWorkerContext &)  ProcessSync,
void Processor,
FWorkerContext InitialContext 
)

Allocates contexts and coordinator, kicks worker tasks that also call ProcessSync. Processor is type-erased to void* to avoid templated code.

◆ RegisterSlowImplementation()

COREUOBJECT_API void UE::GC::RegisterSlowImplementation ( ObjectAROFn  ARO,
EAROFlags  Flags 
)

◆ ReleaseAsyncProcessingContexts()

void UE::GC::ReleaseAsyncProcessingContexts ( FWorkerContext InContext,
TArrayView< FWorkerContext * >  Contexts 
)

◆ StealWork()

COREUOBJECT_API ELoot UE::GC::StealWork ( FWorkerContext Context,
FReferenceCollector Collector,
FWorkBlock *&  OutBlock,
EGCOptions  Options 
)

◆ SuspendWork()

COREUOBJECT_API void UE::GC::SuspendWork ( FWorkerContext Context)

◆ ToImmutableReference()

FORCEINLINE FImmutableReference UE::GC::ToImmutableReference ( FMutableReference  In)

◆ ToName() [1/3]

FName UE::GC::ToName ( const char Name)
inline

◆ ToName() [2/3]

COREUOBJECT_API FName UE::GC::ToName ( EMemberType  Type)

◆ ToName() [3/3]

FName UE::GC::ToName ( FPropertyStack Stack)
inline

◆ ToReference() [1/3]

template<class RefType >
RefType UE::GC::ToReference ( FMutableReference  In)

◆ ToReference() [2/3]

template<>
FORCEINLINE FImmutableReference UE::GC::ToReference ( FMutableReference  In)

◆ ToReference() [3/3]

template<>
FORCEINLINE FMutableReference UE::GC::ToReference ( FMutableReference  In)

◆ ToResolvedReference() [1/2]

FORCEINLINE FImmutableReference UE::GC::ToResolvedReference ( FImmutableReference  In)

◆ ToResolvedReference() [2/2]

FORCEINLINE FResolvedMutableReference UE::GC::ToResolvedReference ( FMutableReference  In)

◆ ToWord() [1/2]

FMemberWord UE::GC::ToWord ( FSchemaView  In)
inline

◆ ToWord() [2/2]

FMemberWord UE::GC::ToWord ( StructAROFn  In)
inline

◆ TSAN_ATOMIC()

COREUOBJECT_API UE::GC::TSAN_ATOMIC ( bool  )
extern

true if incremental reachability analysis is in progress (global for faster access in low level structs and functions otherwise use IsIncrementalReachabilityAnalisysPending())

◆ VisitInnerSchemas()

template<typename Fn >
void UE::GC::VisitInnerSchemas ( FSchemaView  Schema,
Fn  Visitor 
)

Variable Documentation

◆ DefaultOptions

constexpr EGCOptions UE::GC::DefaultOptions = EGCOptions::AutogenerateSchemas
inlineconstexpr

◆ GIntrinsicClassSchemas

TMap<UClass*, FSchemaOwner> UE::GC::GIntrinsicClassSchemas

◆ GIsIncrementalReachabilityPending

bool UE::GC::GIsIncrementalReachabilityPending = false

◆ GMaybeUnreachableObjectFlag

EInternalObjectFlag value representing a maybe unreachable object

Current EInternalObjectFlags value representing a maybe unreachable object

◆ GReachabilityState

FReachabilityAnalysisState UE::GC::GReachabilityState

◆ GReachableObjectFlag

EInternalObjectFlags value representing a reachable object

Current EInternalObjectFlags value representing a reachable object

◆ GUnreachableObjectFlag

EInternalObjectFlag value representing an unreachable object

Current EInternalObjectFlags value representing an unreachable object

◆ UnknownGCObjectName

constexpr FStringView UE::GC::UnknownGCObjectName = TEXTVIEW("Unknown FGCObject")
inlineconstexpr