UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GarbageCollectionHistory.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 GarbageCollectionHistory.h: Unreal realtime garbage collection history
5=============================================================================*/
6
7#pragma once
8
9#include "Containers/Array.h"
10#include "Containers/Map.h"
11#include "HAL/Platform.h"
15#include "UObject/NameTypes.h"
17
18class FGCObjectInfo;
19class UObject;
20
21#if ENABLE_GC_HISTORY
22
26struct FGCSnapshot
27{
30#if WITH_VERSE_VM || defined(__INTELLISENSE__)
33#endif
36
38 int64 GetAllocatedSize() const;
39};
40
44class FGCHistory
45{
47 TArray<FGCSnapshot> Snapshots;
51 UObject* GCBarrier = nullptr;
52
54
58
59public:
60
63
66
69
74 COREUOBJECT_API void SetHistorySize(int32 HistorySize);
75
76 UE_FORCEINLINE_HINT int32 GetHistorySize() const
77 {
78 return Snapshots.Num();
79 }
80
81 UE_FORCEINLINE_HINT bool IsActive() const
82 {
83 return GetHistorySize() > 0;
84 }
85
92
97 {
98 return GetSnapshot(0);
99 }
100
103
106 {
107 return GCBarrier;
108 }
109};
110
111#endif // ENABLE_GC_HISTORY
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition GCObjectInfo.h:28
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition Object.h:95
SIZE_T GetAllocatedSize(const T &Value)
Definition ManagedArray.h:93
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
Definition ReferenceToken.h:44