5#include "Containers/Array.h"
7#include "Containers/HashTable.h"
8#include "Containers/Map.h"
9#include "Containers/Set.h"
36#if defined(WITH_RTTI) || defined(_CPPRTTI) || defined(__GXX_RTTI) || WITH_EDITOR
46#define UE_MEMORYIMAGE_TRACK_TYPE_DEPENDENCIES (WITH_EDITORONLY_DATA)
58#if UE_MEMORYIMAGE_TRACK_TYPE_DEPENDENCIES
80 template<
typename TOther>
87 template<
typename TOther>
131 if (FrozenSize == 0u &&
Object)
168 return !(*
this == Rhs);
174 return Offset < Rhs.Offset;
189 return !(*
this == Rhs);
193 if (
Name != Rhs.Name)
197 return Offset < Rhs.Offset;
372 static_assert(
INDEX_NONE == -1,
"TypeIndex cannot store INDEX_NONE when it's not -1");
410 inline operator T*()
const {
return Get(); }
424 const T* RawPtr =
Get();
439 inline T* GetFrozenPtrInternal()
const
476 const T* RawPtr =
Object.Get();
522 return FMath::Min(8u, LayoutParams.MaxFieldAlignment);
571 this->Ptr =
Other.Ptr;
590 this->Ptr =
Other.Ptr;
623 return CurrentMax * NumBytesPerElement;
640template<u
int32 Alignment = DEFAULT_ALIGNMENT>
699 template<
typename ElementType>
714template <u
int32 Alignment>
730template<
typename ElementType,
typename KeyFuncs = DefaultKeyFuncs<ElementType>>
733template <
typename KeyType,
typename ValueType,
typename KeyFuncs = TDefaultMapHashableKeyFuncs<KeyType, ValueType, false>>
772 int32 DestLen = FPlatformString::ConvertedLength<TCHAR>(Src, SrcLen);
773 Data.AddUninitialized(DestLen);
774 FPlatformString::Convert(Data.GetData(), DestLen, Src, SrcLen);
780 return FString::ConstructFromPtrSize(Data.GetData(),
Len());
785 return Data.Num() ? Data.GetData() :
TEXT(
"");
793 return Data.Num() ? Data.Num() - 1 : 0;
841#if WITH_EDITORONLY_DATA
872#if WITH_EDITORONLY_DATA
924 template<
typename PtrType>
927 int32 NumOffsets = 0;
959template<
typename T,
typename PtrType>
967 Pointers.
Reset(NewSize);
994 Pointers.
Add(
nullptr);
1050#pragma warning(push)
1051#pragma warning(disable : 4583)
1060template<
typename T,
typename PtrType>
1079 else new(&
Ptr) PtrType(Rhs);
1087 else new(&
Ptr) PtrType(Rhs);
1095 else new(&
Ptr) PtrType(Rhs);
1108 SafeReleaseImpl(
Ptr);
1137 IsFrozenMask = (1 << 0),
1141 static void SafeReleaseImpl(T*&
InPtr)
1152 InPtr.SafeRelease();
1155 static_assert(
sizeof(PtrType) <=
sizeof(
uint64),
"PtrType must fit within a standard pointer");
1167template<
typename T,
typename PtrType>
1175 template<
typename T,
typename PtrType>
1192 template<
typename T,
typename PtrType>
1199 template<
typename T,
typename PtrType>
1205 template<
typename T,
typename PtrType>
1208 return FMath::Min(8u, LayoutParams.MaxFieldAlignment);
1218template<
typename T,
typename PtrType>
1234 inline operator T*()
const {
return Get(); }
1237 static_assert(
sizeof(PtrType) ==
sizeof(
void*),
"PtrType must be a standard pointer");
constexpr T Align(T Val, uint64 Alignment)
Definition AlignmentTemplates.h:18
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
bool LoadFromCompactBinary(FCbFieldView Field, FAssetDependency &Dependency)
Definition AssetRegistry.cpp:10420
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackReserve(SizeType NewMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:223
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:139
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:169
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_NONCOPYABLE(TypeName)
Definition CoreMiscDefines.h:457
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Patch
Patch version increments fix existing functionality without changing the API.
void InternalDeleteObjectFromLayout(void *Object, const FTypeLayoutDesc &TypeDesc, const FPointerTableBase *PtrTable, bool bIsFrozen)
Definition MemoryImage.cpp:330
CORE_API void * UnfreezeMemoryImageObject(const void *FrozenObject, const FTypeLayoutDesc &TypeDesc, const FPointerTableBase *PointerTable)
Definition MemoryImage.cpp:1451
TSet< ElementType, KeyFuncs, FMemoryImageSetAllocator > TMemoryImageSet
Definition MemoryImage.h:731
CORE_API FMemoryImageObject FreezeMemoryImageObject(const void *Object, const FTypeLayoutDesc &TypeDesc, FPointerTableBase *PointerTable)
Definition MemoryImage.cpp:1427
#define DECLARE_TEMPLATE_INTRINSIC_TYPE_LAYOUT(TemplatePrefix, T)
Definition MemoryLayout.h:661
#define LAYOUT_FIELD(T, Name,...)
Definition MemoryLayout.h:471
#define LAYOUT_TOSTRING(Func)
Definition MemoryLayout.h:481
#define DECLARE_EXPORTED_TYPE_LAYOUT(T, RequiredAPI, Interface)
Definition MemoryLayout.h:559
void DeleteObjectFromLayout(T *Object, const FPointerTableBase *PtrTable=nullptr, bool bIsFrozen=false)
Definition MemoryLayout.h:654
const FTypeLayoutDesc & GetTypeLayoutDesc(const FPointerTableBase *, const T &Object)
Definition MemoryLayout.h:649
#define LAYOUT_FIELD_EDITORONLY(T, Name,...)
Definition MemoryLayout.h:488
#define DECLARE_INTRINSIC_TYPE_LAYOUT(T)
Definition MemoryLayout.h:760
uint32 Offset
Definition VulkanMemory.cpp:4033
uint32 Size
Definition VulkanMemory.cpp:4034
Definition Archive.h:1208
Definition CompactBinary.h:610
Definition CompactBinaryWriter.h:68
Definition MemoryImage.h:858
FHashedName()
Definition MemoryImage.h:861
bool IsNone() const
Definition MemoryImage.h:870
bool operator==(const FHashedName &Rhs) const
Definition MemoryImage.h:876
bool operator!=(const FHashedName &Rhs) const
Definition MemoryImage.h:877
CORE_API FHashedName & operator=(const FHashedName &InName)
Definition MemoryImage.cpp:1286
uint64 GetHash() const
Definition MemoryImage.h:869
friend uint32 GetTypeHash(const FHashedName &Name)
Definition MemoryImage.h:888
friend FArchive & operator<<(FArchive &Ar, FHashedName &String)
Definition MemoryImage.h:882
bool operator<(const FHashedName &Rhs) const
Definition MemoryImage.h:880
Definition MemoryImage.h:600
CORE_API void CopyUnfrozen(const FMemoryUnfreezeContent &Context, const FTypeLayoutDesc &TypeDesc, int32 NumAllocatedElements, void *Dst) const
Definition MemoryImageAllocator.cpp:90
FMemoryImageAllocatorBase()=default
CORE_API ~FMemoryImageAllocatorBase()
Definition MemoryImageAllocator.cpp:21
CORE_API void MoveToEmpty(FMemoryImageAllocatorBase &Other)
Definition MemoryImageAllocator.cpp:33
CORE_API void WriteMemoryImage(FMemoryImageWriter &Writer, const FTypeLayoutDesc &TypeDesc, int32 NumAllocatedElements, uint32 Alignment) const
Definition MemoryImageAllocator.cpp:74
UE_FORCEINLINE_HINT bool HasAllocation()
Definition MemoryImage.h:625
UE_FORCEINLINE_HINT FScriptContainerElement * GetAllocation() const
Definition MemoryImage.h:616
CORE_API void ResizeAllocation(int32 PreviousNumElements, int32 NumElements, SIZE_T NumBytesPerElement, uint32 Alignment)
Definition MemoryImageAllocator.cpp:48
UE_FORCEINLINE_HINT int64 GetFrozenOffsetFromThis() const
Definition MemoryImage.h:629
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(int32 CurrentMax, SIZE_T NumBytesPerElement) const
Definition MemoryImage.h:621
Definition MemoryImage.h:216
TArray< FSectionPointer > Pointers
Definition MemoryImage.h:276
TArray< FMemoryImageVTablePointer > VTables
Definition MemoryImage.h:277
uint32 WriteBytes(const T &Data)
Definition MemoryImage.h:263
CORE_API uint32 WriteFScriptName(const FScriptName &Name)
Definition MemoryImage.cpp:1937
uint32 MaxAlignment
Definition MemoryImage.h:281
FSHAHash Hash
Definition MemoryImage.h:280
CORE_API uint32 WriteVTable(const FTypeLayoutDesc &TypeDesc, const FTypeLayoutDesc &DerivedTypeDesc)
Definition MemoryImage.cpp:1913
FMemoryImageSection(FMemoryImage *InImage)
Definition MemoryImage.h:225
uint32 WriteZeroBytes(int32 Num)
Definition MemoryImage.h:255
CORE_API FMemoryImageSection * WritePointer(const FTypeLayoutDesc &StaticTypeDesc, const FTypeLayoutDesc &DerivedTypeDesc, uint32 *OutOffsetToBase=nullptr)
Definition MemoryImage.cpp:1870
FMemoryImage * ParentImage
Definition MemoryImage.h:274
void WritePaddingToSize(uint32 Offset)
Definition MemoryImage.h:241
uint32 WriteBytes(const void *Data, uint32 Size)
Definition MemoryImage.h:247
TArray< FMemoryImageNamePointer > MemoryImageNames
Definition MemoryImage.h:279
CORE_API uint32 WriteRawPointerSizedBytes(uint64 PointerValue)
Definition MemoryImage.cpp:1901
TArray< uint8 > Bytes
Definition MemoryImage.h:275
CORE_API uint32 Flatten(FMemoryImageResult &OutResult) const
Definition MemoryImage.cpp:1949
CORE_API void ComputeHash()
Definition MemoryImage.cpp:1994
TArray< FMemoryImageNamePointer > ScriptNames
Definition MemoryImage.h:278
CORE_API uint32 WriteFMemoryImageName(int32 NumBytes, const FName &Name)
Definition MemoryImage.cpp:1925
uint32 GetOffset() const
Definition MemoryImage.h:230
uint32 WriteAlignment(uint32 Alignment)
Definition MemoryImage.h:232
Definition MemoryImage.h:743
FMemoryImageString & operator=(FMemoryImageString &&)=default
friend FArchive & operator<<(FArchive &Ar, FMemoryImageString &Ref)
Definition MemoryImage.h:806
UE_FORCEINLINE_HINT const TCHAR * operator*() const
Definition MemoryImage.h:783
bool operator==(const FString &Rhs) const
Definition MemoryImage.h:822
FMemoryImageString & operator=(const FMemoryImageString &)=default
friend int32 GetNum(const FMemoryImageString &String)
Definition MemoryImage.h:801
friend const TCHAR * GetData(const FMemoryImageString &String)
Definition MemoryImage.h:796
UE_FORCEINLINE_HINT int32 Len() const
Definition MemoryImage.h:791
FMemoryImageString()=default
UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize() const
Definition MemoryImage.h:789
UE_FORCEINLINE_HINT FMemoryImageString(const FString &Other)
Definition MemoryImage.h:761
UE_FORCEINLINE_HINT bool IsEmpty() const
Definition MemoryImage.h:788
TCHAR ElementType
Definition MemoryImage.h:753
bool operator==(const FMemoryImageString &Rhs) const
Definition MemoryImage.h:812
FMemoryImageString(const FMemoryImageString &)=default
friend UE_FORCEINLINE_HINT uint32 GetTypeHash(const FMemoryImageString &S)
Definition MemoryImage.h:835
DataType::ElementAllocatorType & GetAllocatorInstance()
Definition MemoryImage.h:832
bool operator!=(const FMemoryImageString &Rhs) const
Definition MemoryImage.h:817
FMemoryImageString(FMemoryImageString &&)=default
FMemoryImageString(const CharType *Src)
Definition MemoryImage.h:767
bool operator!=(const FString &Rhs) const
Definition MemoryImage.h:827
Definition MemoryImageWriter.h:14
CORE_API void WriteObject(const void *Object, const FTypeLayoutDesc &TypeDesc)
Definition MemoryImage.cpp:2099
CORE_API uint32 WriteBytes(const void *Data, uint32 Size)
Definition MemoryImage.cpp:2143
CORE_API uint32 WriteNullPointer()
Definition MemoryImage.cpp:2148
CORE_API FPointerTableBase & GetPointerTable() const
Definition MemoryImage.cpp:2091
CORE_API const FPointerTableBase * TryGetPrevPointerTable() const
Definition MemoryImage.cpp:2092
CORE_API FMemoryImageWriter WritePointer(const FTypeLayoutDesc &StaticTypeDesc, const FTypeLayoutDesc &DerivedTypeDesc, uint32 *OutOffsetToBase=nullptr)
Definition MemoryImage.cpp:2153
Definition MemoryImage.h:285
TArray< TRefCountPtr< FMemoryImageSection > > Sections
Definition MemoryImage.h:311
const FPointerTableBase * PrevPointerTable
Definition MemoryImage.h:313
CORE_API void Flatten(FMemoryImageResult &OutResult, bool bMergeDuplicateSections=false)
Definition MemoryImage.cpp:2006
const FPointerTableBase & GetPrevPointerTable() const
Definition MemoryImage.h:296
FPointerTableBase & GetPointerTable() const
Definition MemoryImage.h:295
FMemoryImageSection * AllocateSection()
Definition MemoryImage.h:298
FPlatformTypeLayoutParameters HostLayoutParameters
Definition MemoryImage.h:314
FPointerTableBase * PointerTable
Definition MemoryImage.h:312
FPlatformTypeLayoutParameters TargetLayoutParameters
Definition MemoryImage.h:315
FMemoryImage()
Definition MemoryImage.h:287
const class UStruct * CurrentStruct
Definition MemoryImage.h:316
Definition MemoryImageWriter.h:78
Definition NameTypes.h:617
CORE_API int32 Compare(const FName &Other) const
Definition UnrealNames.cpp:3478
FORCEINLINE bool LexicalLess(const FName &Other) const
Definition NameTypes.h:821
Definition MemoryImage.h:49
const FTypeLayoutDesc * GetTypeDependency(int32 Index) const
Definition MemoryImage.h:65
virtual int32 AddIndexedPointer(const FTypeLayoutDesc &TypeDesc, void *Ptr)=0
virtual CORE_API void SaveToArchive(FArchive &Ar, const FPlatformTypeLayoutParameters &LayoutParams, const void *FrozenObject) const
Definition MemoryImage.cpp:1337
virtual ~FPointerTableBase()
Definition MemoryImage.h:51
virtual void * GetIndexedPointer(const FTypeLayoutDesc &TypeDesc, uint32 i) const =0
virtual CORE_API bool LoadFromArchive(FArchive &Ar, const FPlatformTypeLayoutParameters &LayoutParams, void *FrozenObject)
Definition MemoryImage.cpp:1358
int32 AddTypeDependency(const FTypeLayoutDesc &TypeDesc)
Definition MemoryImage.h:64
Definition MemoryImage.h:922
static void LoadAndApplyPatchesFromArchive(FArchive &Ar, void *FrozenBase, const PtrType &Ptr)
Definition MemoryImage.h:925
TArray< FPatchOffset > PatchOffsets
Definition MemoryImage.h:956
CORE_API void AddPatchedPointerBase(uint32 PtrIndex, uint64 Offset)
Definition MemoryImage.cpp:1855
CORE_API void SavePatchesToArchive(FArchive &Ar, uint32 PtrIndex) const
Definition MemoryImage.cpp:1832
TArray< FPatchOffsetList > PatchLists
Definition MemoryImage.h:955
Definition RefCounting.h:252
Definition SecureHash.h:314
Definition SecureHash.h:226
Definition MemoryImage.h:1047
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void SetNumZeroed(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2340
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_NODEBUG UE_FORCEINLINE_HINT RangedForIteratorType end()
Definition Array.h:3391
bool Contains(const ComparisonType &Item) const
Definition Array.h:1518
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_NODEBUG UE_FORCEINLINE_HINT RangedForIteratorType begin()
Definition Array.h:3389
std::conditional_t< AllocatorType::NeedsElementType, typename AllocatorType::template ForElementType< ElementType >, typename AllocatorType::ForAnyElementType > ElementAllocatorType
Definition Array.h:687
void SetNumUninitialized(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2369
UE_FORCEINLINE_HINT SizeType AddUnique(ElementType &&Item)
Definition Array.h:2993
Definition MemoryImage.h:1062
bool IsValid() const
Definition MemoryImage.h:1101
TIndexedPtrBase(const TIndexedPtrBase< T, PtrType > &Rhs, const FPtrTable &InTable)
Definition MemoryImage.h:1072
PtrType Ptr
Definition MemoryImage.h:1158
T * GetUnfrozen() const
Definition MemoryImage.h:1132
uint64 PackedIndex
Definition MemoryImage.h:1159
TIndexedPtrBase & operator=(T *Rhs)
Definition MemoryImage.h:1074
T * Get(const FPtrTable &PtrTable) const
Definition MemoryImage.h:1112
~TIndexedPtrBase()
Definition MemoryImage.h:1067
bool IsFrozen() const
Definition MemoryImage.h:1100
T * Get(const FPointerTableBase *PtrTable) const
Definition MemoryImage.h:1121
TIndexedPtrBase & operator=(PtrType &&Rhs)
Definition MemoryImage.h:1092
TIndexedPtrBase & operator=(const PtrType &Rhs)
Definition MemoryImage.h:1084
bool IsNull() const
Definition MemoryImage.h:1102
TIndexedPtrBase(T *InPtr=nullptr)
Definition MemoryImage.h:1066
TIndexedPtrBase(const TIndexedPtrBase< T, PtrType > &Rhs)
Definition MemoryImage.h:1070
void SafeRelease()
Definition MemoryImage.h:1104
Definition UnrealString.h.inl:34
Definition MemoryImage.h:651
UE_FORCEINLINE_HINT int32 CalculateSlackShrink(int32 NewMax, int32 CurrentMax, int32 NumBytesPerElement) const
Definition MemoryImage.h:668
ForAnyElementType()=default
UE_FORCEINLINE_HINT int32 CalculateSlackReserve(int32 NewMax, int32 NumBytesPerElement, uint32 AlignmentOfElement) const
Definition MemoryImage.h:664
UE_FORCEINLINE_HINT int32 CalculateSlackGrow(int32 NewMax, int32 CurrentMax, int32 NumBytesPerElement, uint32 AlignmentOfElement) const
Definition MemoryImage.h:680
UE_FORCEINLINE_HINT void ResizeAllocation(int32 CurrentNum, int32 NewMax, SIZE_T NumBytesPerElement, uint32 AlignmentOfElement)
Definition MemoryImage.h:688
UE_FORCEINLINE_HINT int32 CalculateSlackShrink(int32 NewMax, int32 CurrentMax, int32 NumBytesPerElement, uint32 AlignmentOfElement) const
Definition MemoryImage.h:672
UE_FORCEINLINE_HINT void ResizeAllocation(int32 CurrentNum, int32 NewMax, SIZE_T NumBytesPerElement)
Definition MemoryImage.h:684
UE_FORCEINLINE_HINT int32 CalculateSlackGrow(int32 NewMax, int32 CurrentMax, int32 NumBytesPerElement) const
Definition MemoryImage.h:676
UE_FORCEINLINE_HINT void WriteMemoryImage(FMemoryImageWriter &Writer, const FTypeLayoutDesc &TypeDesc, int32 NumAllocatedElements) const
Definition MemoryImage.h:693
UE_FORCEINLINE_HINT int32 CalculateSlackReserve(int32 NewMax, int32 NumBytesPerElement) const
Definition MemoryImage.h:660
UE_FORCEINLINE_HINT SizeType GetInitialCapacity() const
Definition MemoryImage.h:656
Definition MemoryImage.h:701
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition MemoryImage.h:704
ForElementType()
Definition MemoryImage.h:703
Definition MemoryImage.h:642
@ NeedsElementType
Definition MemoryImage.h:646
int32 SizeType
Definition MemoryImage.h:644
@ SupportsFreezeMemoryImage
Definition MemoryImage.h:648
@ RequireRangeCheck
Definition MemoryImage.h:647
Definition MemoryImage.h:382
TMemoryImagePtr()
Definition MemoryImage.h:388
bool IsValid() const
Definition MemoryImage.h:385
TMemoryImagePtr(T *InPtr)
Definition MemoryImage.h:389
T * operator->() const
Definition MemoryImage.h:408
void SafeDelete(const FPointerTableBase *PtrTable=nullptr)
Definition MemoryImage.h:412
TMemoryImagePtr & operator=(const TMemoryImagePtr< T > &InPtr)
Definition MemoryImage.h:392
int64 GetFrozenOffsetFromThis() const
Definition MemoryImage.h:399
TMemoryImagePtr & operator=(T *InPtr)
Definition MemoryImage.h:391
FFrozenMemoryImagePtr Frozen
Definition MemoryImage.h:448
T * Get() const
Definition MemoryImage.h:402
T * GetChecked() const
Definition MemoryImage.h:407
~TMemoryImagePtr()
Definition MemoryImage.h:394
bool IsFrozen() const
Definition MemoryImage.h:384
uint64 Packed
Definition MemoryImage.h:447
TMemoryImagePtr(const TMemoryImagePtr< T > &InPtr)
Definition MemoryImage.h:390
bool IsNull() const
Definition MemoryImage.h:386
int32 GetFrozenTypeIndex() const
Definition MemoryImage.h:400
void WriteMemoryImageWithDerivedType(FMemoryImageWriter &Writer, const FTypeLayoutDesc *DerivedTypeDesc) const
Definition MemoryImage.h:422
T & operator*() const
Definition MemoryImage.h:409
T * UnfrozenPtr
Definition MemoryImage.h:449
Definition MemoryImage.h:1220
T & operator*() const
Definition MemoryImage.h:1233
TPatchedPtrBase(T *InPtr=nullptr)
Definition MemoryImage.h:1224
T * operator->() const
Definition MemoryImage.h:1232
T * GetChecked() const
Definition MemoryImage.h:1231
T * Get() const
Definition MemoryImage.h:1226
Definition MemoryImage.h:961
TArray< PtrType >::RangedForConstIteratorType end() const
Definition MemoryImage.h:1033
bool TryAddIndexedPtr(const FTypeLayoutDesc &TypeDesc, void *Ptr, int32 &OutIndex)
Definition MemoryImage.h:973
void Empty(int32 NewSize=0)
Definition MemoryImage.h:965
TArray< PtrType >::RangedForIteratorType end()
Definition MemoryImage.h:1031
void AddPatchedPointer(T *Ptr, uint64 Offset)
Definition MemoryImage.h:998
void LoadIndexedPointer(T *Ptr)
Definition MemoryImage.h:983
TArray< PtrType >::RangedForIteratorType begin()
Definition MemoryImage.h:1030
bool TryGetIndexedPtr(const FTypeLayoutDesc &TypeDesc, uint32 i, void *&OutPtr) const
Definition MemoryImage.h:1006
static const FTypeLayoutDesc & StaticGetPtrTypeLayoutDesc()
Definition MemoryImage.h:1168
void ApplyPointerPatches(void *FrozenBase) const
Definition MemoryImage.h:1016
TArray< PtrType >::RangedForConstIteratorType begin() const
Definition MemoryImage.h:1032
T * GetIndexedPointer(uint32 i) const
Definition MemoryImage.h:1004
uint32 AddIndexedPointer(T *Ptr)
Definition MemoryImage.h:971
uint32 Num() const
Definition MemoryImage.h:970
Definition MemoryImage.h:1039
Definition MemoryImage.h:1043
Definition RefCounting.h:454
Definition ContainerAllocationPolicies.h:1662
Definition ContainerAllocationPolicies.h:1383
Definition MemoryImage.h:559
TUniqueMemoryImagePtr & operator=(T *InPtr)
Definition MemoryImage.h:578
TUniqueMemoryImagePtr & operator=(TUniqueMemoryImagePtr &&Other)
Definition MemoryImage.h:584
~TUniqueMemoryImagePtr()
Definition MemoryImage.h:574
TUniqueMemoryImagePtr(T *InPtr)
Definition MemoryImage.h:564
TUniqueMemoryImagePtr(TUniqueMemoryImagePtr &&Other)
Definition MemoryImage.h:568
TUniqueMemoryImagePtr()
Definition MemoryImage.h:561
Definition FieldSystemNoiseAlgo.cpp:6
CORE_API uint32 AppendHashForNameAndSize(const TCHAR *Name, uint32 Size, FSHA1 &Hasher)
Definition MemoryImage.cpp:568
UE_NODEBUG void IntrinsicWriteMemoryImage(FMemoryImageWriter &Writer, const TArray< T, AllocatorType > &Object, const FTypeLayoutDesc &)
Definition Array.h:3957
UE_NODEBUG uint32 IntrinsicUnfrozenCopy(const FMemoryUnfreezeContent &Context, const TArray< T, AllocatorType > &Object, void *OutDst)
Definition Array.h:3963
UE_NODEBUG void IntrinsicToString(const TArray< T, AllocatorType > &Object, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FMemoryToStringContext &OutContext)
Definition Array.h:3983
UE_NODEBUG uint32 IntrinsicGetTargetAlignment(const TArray< T, AllocatorType > *DummyObject, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams)
Definition Array.h:3976
UE_NODEBUG uint32 IntrinsicAppendHash(const TArray< T, AllocatorType > *DummyObject, const FTypeLayoutDesc &TypeDesc, const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher)
Definition Array.h:3970
U16 Index
Definition radfft.cpp:71
static uint32 Strihash_DEPRECATED(const CharType *Data)
Definition MemoryImage.h:324
static constexpr uint64 bIsFrozenMask
Definition MemoryImage.h:333
void SetOffsetFromThis(int64 Offset)
Definition MemoryImage.h:359
int64 GetOffsetFromThis() const
Definition MemoryImage.h:351
uint64 Packed
Definition MemoryImage.h:337
static constexpr uint64 TypeIndexMask
Definition MemoryImage.h:334
static constexpr uint64 bIsFrozenShift
Definition MemoryImage.h:329
static constexpr uint64 OffsetShift
Definition MemoryImage.h:331
void SetIsFrozen(bool bTrue)
Definition MemoryImage.h:345
static constexpr uint64 TypeIndexBits
Definition MemoryImage.h:327
static constexpr uint64 TypeIndexShift
Definition MemoryImage.h:330
bool IsFrozen() const
Definition MemoryImage.h:340
static constexpr uint64 OffsetMask
Definition MemoryImage.h:335
static constexpr uint64 bIsFrozenBits
Definition MemoryImage.h:325
static constexpr uint64 OffsetBits
Definition MemoryImage.h:326
int32 GetTypeIndex() const
Definition MemoryImage.h:365
void SetTypeIndex(int32 TypeIndex)
Definition MemoryImage.h:370
Definition MemoryImage.h:179
bool operator==(const FMemoryImageNamePointer &Rhs) const
Definition MemoryImage.h:183
bool operator<(const FMemoryImageNamePointer &Rhs) const
Definition MemoryImage.h:191
bool operator!=(const FMemoryImageNamePointer &Rhs) const
Definition MemoryImage.h:187
uint32 Offset
Definition MemoryImage.h:181
FName Name
Definition MemoryImage.h:180
Definition MemoryImage.h:202
FPointerTableBase * PointerTable
Definition MemoryImage.h:204
FPlatformTypeLayoutParameters TargetLayoutParameters
Definition MemoryImage.h:205
static CORE_API FMemoryImageObject LoadFromArchive(FArchive &Ar, const FTypeLayoutDesc &TypeDesc, FPointerTableBase *PointerTable, FPlatformTypeLayoutParameters &OutLayoutParameters)
Definition MemoryImage.cpp:1696
TArray< FMemoryImageVTablePointer > VTables
Definition MemoryImage.h:206
TArray< FMemoryImageNamePointer > MemoryImageNames
Definition MemoryImage.h:208
CORE_API void SaveToArchive(FArchive &Ar) const
Definition MemoryImage.cpp:1503
CORE_API bool ApplyPatches(void *FrozenObject, uint64 FrozenObjectSize) const
Definition MemoryImage.cpp:1665
TArray< uint8 > Bytes
Definition MemoryImage.h:203
TArray< FMemoryImageNamePointer > ScriptNames
Definition MemoryImage.h:207
Definition MemoryImage.h:219
uint32 Offset
Definition MemoryImage.h:222
uint32 PointerOffset
Definition MemoryImage.h:221
uint32 SectionIndex
Definition MemoryImage.h:220
Definition MemoryImage.h:157
uint64 TypeNameHash
Definition MemoryImage.h:158
bool operator==(const FMemoryImageVTablePointer &Rhs) const
Definition MemoryImage.h:162
bool operator!=(const FMemoryImageVTablePointer &Rhs) const
Definition MemoryImage.h:166
bool operator<(const FMemoryImageVTablePointer &Rhs) const
Definition MemoryImage.h:170
uint32 Offset
Definition MemoryImage.h:160
uint32 VTableOffset
Definition MemoryImage.h:159
Definition MemoryLayout.h:51
static FORCENOINLINE CORE_API void Free(void *Original)
Definition UnrealMemory.cpp:685
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
Definition MemoryImage.h:947
uint32 FirstIndex
Definition MemoryImage.h:949
uint32 NumOffsets
Definition MemoryImage.h:950
FPatchOffsetList()
Definition MemoryImage.h:948
Definition MemoryImage.h:941
uint32 NextIndex
Definition MemoryImage.h:943
uint32 Offset
Definition MemoryImage.h:942
Definition ContainerAllocationPolicies.h:242
Definition NameTypes.h:491
Definition MemoryLayout.h:108
const TCHAR * Name
Definition MemoryLayout.h:127
Definition ContainerAllocationPolicies.h:247
@ SupportsElementAlignment
Definition ContainerAllocationPolicies.h:250
@ SupportsFreezeMemoryImage
Definition ContainerAllocationPolicies.h:249
@ IsZeroConstruct
Definition ContainerAllocationPolicies.h:248
Definition ContainerAllocationPolicies.h:256
static UE_FORCEINLINE_HINT int32 Stricmp(const CharType *String1, const CharType *String2)
Definition CString.h:1030
static int32 Strlen(const CharType *String)
Definition CString.h:1047
Definition IsContiguousContainer.h:16
static constexpr bool Value
Definition IsContiguousContainer.h:20
Definition MemoryImage.h:71
TMemoryImageObject(const FTypeLayoutDesc &InTypeDesc, T *InObject, uint32 InFrozenSize)
Definition MemoryImage.h:74
const FTypeLayoutDesc * TypeDesc
Definition MemoryImage.h:100
uint32 FrozenSize
Definition MemoryImage.h:102
TMemoryImageObject()
Definition MemoryImage.h:72
void Destroy(const FPointerTableBase *PointerTable)
Definition MemoryImage.h:110
TMemoryImageObject(const TMemoryImageObject< TOther > &Rhs)
Definition MemoryImage.h:88
T * Object
Definition MemoryImage.h:101
bool Unfreeze(const FPointerTableBase *PointerTable)
Definition MemoryImage.h:143
TMemoryImageObject(TOther *InObject)
Definition MemoryImage.h:81
bool Freeze(FPointerTableBase *PointerTable)
Definition MemoryImage.h:129