7#if USING_INSTRUMENTATION
10#include "Containers/Map.h"
29#define SAFE_OPERATOR_NEW_DELETE() \
30 INSTRUMENTATION_FUNCTION_ATTRIBUTES void * operator new(SIZE_T Size) \
32 return FInstrumentationSafeWinAllocator::Alloc(Size); \
34 INSTRUMENTATION_FUNCTION_ATTRIBUTES void operator delete(void* Ptr) \
36 FInstrumentationSafeWinAllocator::Free(Ptr); \
39#define SAFE_OPERATOR_NEW_DELETE_WITH_GUARDS() \
40 INSTRUMENTATION_FUNCTION_ATTRIBUTES void * operator new(SIZE_T Size) \
42 return FInstrumentationSafeWinAllocator::AllocWithGuards(Size); \
44 INSTRUMENTATION_FUNCTION_ATTRIBUTES void operator delete(void* Ptr) \
46 FInstrumentationSafeWinAllocator::FreeWithGuards(Ptr); \
54 return realloc(Data,
Size);
65template <
int IndexSize = 32,
typename TBaseAllocator = TInstrumentationSafeBaseAllocator>
71 using USizeType = std::make_unsigned_t<SizeType>;
74 enum { NeedsElementType =
true };
75 enum { RequireRangeCheck =
true };
77 class ForAnyElementType
97 TBaseAllocator::Free(Data);
101 Other.Data =
nullptr;
109 TBaseAllocator::Free(Data);
122 if (Data || NumElements)
124 static_assert(
sizeof(SizeType) <=
sizeof(
SIZE_T),
"SIZE_T is expected to handle all possible sizes");
128 if constexpr (
sizeof(SizeType) ==
sizeof(
SIZE_T))
134 UE::Core::Private::OnInvalidSizedHeapAllocatorNum(IndexSize, NumElements, NumBytesPerElement);
137 Data = TBaseAllocator::Realloc(Data, NumElements * NumBytesPerElement,
PreviousNumElements * NumBytesPerElement);
171 return NumAllocatedElements * NumBytesPerElement;
185 ForAnyElementType(
const ForAnyElementType&);
186 ForAnyElementType& operator=(
const ForAnyElementType&);
192 template<
typename ElementType>
193 class ForElementType :
public ForAnyElementType
203 return (ElementType*)ForAnyElementType::GetAllocation();
208template <u
int32 NumInlineElements,
typename BaseAllocator = TInstrumentationSafeBaseAllocator>
211template <
typename ElementType,
typename BaseAllocator = TInstrumentationSafeBaseAllocator>
243template <
typename KeyType,
typename ValueType,
typename BaseAllocator = TInstrumentationSafeBaseAllocator>
246template <
typename ElementType,
typename BaseAllocator = TInstrumentationSafeBaseAllocator>
#define checkSlow(expr)
Definition AssertionMacros.h:332
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackReserve(SizeType NewMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:223
#define DEFAULT_MIN_NUMBER_OF_HASHED_ELEMENTS
Definition ContainerAllocationPolicies.h:1514
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:139
#define DEFAULT_NUMBER_OF_ELEMENTS_PER_HASH_BUCKET
Definition ContainerAllocationPolicies.h:1511
#define DEFAULT_BASE_NUMBER_OF_HASH_BUCKETS
Definition ContainerAllocationPolicies.h:1513
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 INSTRUMENTATION_FUNCTION_ATTRIBUTES
Definition Defines.h:5
#define MAX_int32
Definition NumericLimits.h:25
void * GetAllocation(void *Target, uint32 Size, uint32 Offset, uint32 Alignment=16)
Definition OpenGLBuffer.cpp:57
uint32 Size
Definition VulkanMemory.cpp:4034
Definition UnrealString.h.inl:34
Definition ContainerAllocationPolicies.h:894
Definition ContainerAllocationPolicies.h:1383
GeometryCollection::Facades::FMuscleActivationData Data
Definition MuscleActivationConstraints.h:15
SIZE_T GetAllocatedSize(const T &Value)
Definition ManagedArray.h:93
Definition ContainerAllocationPolicies.h:605
Definition NumericLimits.h:41