5#include "Containers/Array.h"
18#define RDG_USE_MALLOC USING_ADDRESS_SANITISER
19#define RDG_ALLOCATOR_DEBUG USING_ADDRESS_SANITISER || UE_BUILD_DEBUG
37 template <
typename...
TArgs>
57#if RDG_ALLOCATOR_DEBUG
69#if RDG_ALLOCATOR_DEBUG
77 template <
typename PODType>
84 template <
typename T,
typename...
TArgs>
87#if RDG_ALLOCATOR_DEBUG
100#if RDG_ALLOCATOR_DEBUG
107 template <
typename T,
typename...
TArgs>
133#if RDG_ALLOCATOR_DEBUG
142 static uint32 AllocatorTLSSlot;
152 void* AllocatorToRestore;
155#define RDG_FRIEND_ALLOCATOR_FRIEND(Type) friend class FRDGAllocator::TObject<Type>
163template<u
int32 Alignment = DEFAULT_ALIGNMENT>
172 template<
typename ElementType>
183 Other.Data =
nullptr;
196 static_assert(
sizeof(
int32) <=
sizeof(
SIZE_T),
"SIZE_T is expected to be larger than int32");
201 UE::RenderCore::Private::OnInvalidRDGAllocatorNum(
NewMax, NumBytesPerElement);
234 return CurrentMax * NumBytesPerElement;
248 ElementType* Data =
nullptr;
254template <u
int32 Alignment>
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
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
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define MAX_int32
Definition NumericLimits.h:25
void * Alloc(size_t AllocSize, size_t Alignment)
Definition MemStack.h:132
CORE_API int32 GetByteCount() const
Definition MemStack.cpp:319
Definition RenderGraphAllocator.h:146
RENDERCORE_API ~FRDGAllocatorScope()
Definition RenderGraphAllocator.cpp:105
Definition RenderGraphAllocator.h:27
virtual ~FObject()=default
Definition RenderGraphAllocator.h:34
Definition RenderGraphAllocator.h:24
int32 GetByteCount() const
Definition RenderGraphAllocator.h:113
FRDGAllocator()
Definition RenderGraphAllocator.cpp:13
void ReleaseAll()
Definition RenderGraphAllocator.cpp:72
static RENDERCORE_API FRDGAllocator & GetTLS()
Definition RenderGraphAllocator.cpp:51
void * Alloc(uint64 SizeInBytes, uint32 AlignInBytes)
Definition RenderGraphAllocator.h:53
T * AllocNoDestruct(TArgs &&... Args)
Definition RenderGraphAllocator.h:108
PODType * AllocUninitialized(uint64 Count=1)
Definition RenderGraphAllocator.h:78
T * Alloc(TArgs &&... Args)
Definition RenderGraphAllocator.h:85
FRDGAllocator & operator=(FRDGAllocator &&)
Definition RenderGraphAllocator.cpp:24
~FRDGAllocator()
Definition RenderGraphAllocator.cpp:46
Definition RenderGraphAllocator.h:174
SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition RenderGraphAllocator.h:227
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition RenderGraphAllocator.h:191
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition RenderGraphAllocator.h:232
void MoveToEmpty(ForElementType &Other)
Definition RenderGraphAllocator.h:178
SizeType GetInitialCapacity() const
Definition RenderGraphAllocator.h:242
SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition RenderGraphAllocator.h:217
bool HasAllocation() const
Definition RenderGraphAllocator.h:237
ElementType * GetAllocation() const
Definition RenderGraphAllocator.h:186
SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition RenderGraphAllocator.h:222
Definition RenderGraphAllocator.h:165
@ NeedsElementType
Definition RenderGraphAllocator.h:169
ForElementType< FScriptContainerElement > ForAnyElementType
Definition RenderGraphAllocator.h:251
int32 SizeType
Definition RenderGraphAllocator.h:167
@ RequireRangeCheck
Definition RenderGraphAllocator.h:170
Definition ContainerAllocationPolicies.h:1662
Definition ContainerAllocationPolicies.h:894
Definition ContainerAllocationPolicies.h:1383
Definition RenderGraphAllocator.h:158
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
Definition ContainerAllocationPolicies.h:247
@ IsZeroConstruct
Definition ContainerAllocationPolicies.h:248
Definition ContainerAllocationPolicies.h:256