23#ifndef UE_ENABLE_ARRAY_SLACK_TRACKING
24#define UE_ENABLE_ARRAY_SLACK_TRACKING (0 && !WITH_EDITOR)
28#if UE_ENABLE_ARRAY_SLACK_TRACKING
60 static void Free(
void* Ptr)
100 return (ArrayMax - ArrayNum) *
ElemSize;
108#ifndef CONTAINER_INITIAL_ALLOC_ZERO_SLACK
109#define CONTAINER_INITIAL_ALLOC_ZERO_SLACK 1
112#if defined(UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR) && !defined(UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR)
113 #error If UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR is defined you must also define UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR
116#if defined(UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR) && !defined(UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR)
117 #error If UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR is defined you must also define UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR
120#ifndef UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR
121 #if AGGRESSIVE_MEMORY_SAVING
122 #define UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR 1
124 #define UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR 3
128#ifndef UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR
129 #if AGGRESSIVE_MEMORY_SAVING
130 #define UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR 4
132 #define UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR 8
138template <
typename SizeType>
168template <
typename SizeType>
171#if !defined(AGGRESSIVE_MEMORY_SAVING)
172 #error "AGGRESSIVE_MEMORY_SAVING must be defined"
174#if AGGRESSIVE_MEMORY_SAVING
187#if CONTAINER_INITIAL_ALLOC_ZERO_SLACK
222template <
typename SizeType>
245template <
typename AllocatorType>
254template <
typename AllocatorType>
259template <
typename FromAllocatorType,
typename ToAllocatorType>
282 template<
typename ElementType>
300 template <
typename OtherAllocatorType>
304 ElementType* GetAllocation()
const;
312 void ResizeAllocation(
327 void ResizeAllocation(
330 SIZE_T NumBytesPerElement,
354 SIZE_T NumBytesPerElement,
382 SIZE_T NumBytesPerElement,
410 SIZE_T NumBytesPerElement,
422 bool HasAllocation()
const;
425 SizeType GetInitialCapacity()
const;
445template<u
int32 Alignment = DEFAULT_ALIGNMENT>
474#if UE_ENABLE_ARRAY_SLACK_TRACKING
475 FArraySlackTrackingHeader::Free(Data);
482 Other.Data =
nullptr;
490#if UE_ENABLE_ARRAY_SLACK_TRACKING
491 FArraySlackTrackingHeader::Free(Data);
512 static_assert(
sizeof(
int32) <=
sizeof(
SIZE_T),
"SIZE_T is expected to be larger than int32");
517 UE::Core::Private::OnInvalidAlignedHeapAllocatorNum(
NewMax, NumBytesPerElement);
520#if UE_ENABLE_ARRAY_SLACK_TRACKING
542 return CurrentMax * NumBytesPerElement;
555#if UE_ENABLE_ARRAY_SLACK_TRACKING
565 FArraySlackTrackingHeader::DisableTracking(Data);
577 template<
typename ElementType>
586 static_assert(
alignof(ElementType) <= MinimumAlignment,
"Using TAlignedHeapAllocator with an alignment lower than the element type's alignment - please update the alignment parameter");
596template <u
int32 Alignment>
603template <
int IndexSize>
607 static_assert(IndexSize == IndexSize+1,
"Unsupported allocator index size.");
616template <
int IndexSize,
typename BaseMallocType = FMemory>
624 using USizeType = std::make_unsigned_t<SizeType>;
632 template <
int,
typename>
652 template <
typename OtherAllocator>
659#if UE_ENABLE_ARRAY_SLACK_TRACKING
660 FArraySlackTrackingHeader::Free(Data);
662 BaseMallocType::Free(Data);
667 Other.Data =
nullptr;
687#if UE_ENABLE_ARRAY_SLACK_TRACKING
688 FArraySlackTrackingHeader::Free(Data);
690 BaseMallocType::Free(Data);
705 static_assert(
sizeof(
SizeType) <=
sizeof(
SIZE_T),
"SIZE_T is expected to handle all possible sizes");
715 UE::Core::Private::OnInvalidSizedHeapAllocatorNum(IndexSize,
NewMax, NumBytesPerElement);
718#if UE_ENABLE_ARRAY_SLACK_TRACKING
730 static_assert(
sizeof(
SizeType) <=
sizeof(
SIZE_T),
"SIZE_T is expected to handle all possible sizes");
740 UE::Core::Private::OnInvalidSizedHeapAllocatorNum(IndexSize,
NewMax, NumBytesPerElement);
743#if UE_ENABLE_ARRAY_SLACK_TRACKING
777 return CurrentMax * NumBytesPerElement;
790#if UE_ENABLE_ARRAY_SLACK_TRACKING
800 FArraySlackTrackingHeader::DisableTracking(Data);
812 template<
typename ElementType>
842#if !UE_MERGED_MODULES && !defined(UE_HEADER_UNITS)
849template <u
int8 IndexSize>
852 enum { IsZeroConstruct =
true };
853 enum { SupportsElementAlignment =
true };
854 enum { SupportsSlackTracking =
true };
859template <u
int8 FromIndexSize, u
int8 ToIndexSize>
874 template <
typename AllocatorType>
878 template <
bool bFallback,
typename AllocatorType>
883 return AllocatorType::ShrinkByDefault;
892template <u
int32 NumInlineElements,
int IndexSize,
typename SecondaryAllocator = FDefaultAllocator>
898 static_assert(std::is_same_v<SizeType, typename SecondaryAllocator::SizeType>,
"Secondary allocator SizeType mismatch");
902 enum {
ShrinkByDefault = UE::Core::Private::ShrinkByDefaultOr<true, SecondaryAllocator>() };
904 template<
typename ElementType>
936 if (!
Other.SecondaryData.GetAllocation())
944 SecondaryData.MoveToEmpty(
Other.SecondaryData);
950 if (ElementType* Result = SecondaryData.GetAllocation())
954 return GetInlineElements();
963 if(
NewMax <= NumInlineElements)
966 if(SecondaryData.GetAllocation())
971 SecondaryData.ResizeAllocation(0,0,NumBytesPerElement);
976 if(!SecondaryData.GetAllocation())
979 SecondaryData.ResizeAllocation(0,
NewMax,NumBytesPerElement);
987 SecondaryData.ResizeAllocation(CurrentNum,
NewMax, NumBytesPerElement);
995 return NewMax <= NumInlineElements ?
997 SecondaryData.CalculateSlackReserve(
NewMax, NumBytesPerElement);
1002 return NewMax <= NumInlineElements ?
1004 SecondaryData.CalculateSlackShrink(
NewMax, CurrentMax, NumBytesPerElement);
1012 return NewMax <= NumInlineElements ?
1014 SecondaryData.CalculateSlackGrow(
NewMax, CurrentMax <= NumInlineElements ? 0 : CurrentMax, NumBytesPerElement);
1019 if (CurrentMax > NumInlineElements)
1021 return SecondaryData.GetAllocatedSize(CurrentMax, NumBytesPerElement);
1028 return SecondaryData.HasAllocation();
1033 return NumInlineElements;
1036#if UE_ENABLE_ARRAY_SLACK_TRACKING
1041 SecondaryData.SlackTrackerLogNum(
NewNumUsed);
1051 alignas(ElementType)
uint8 InlineData[
sizeof(ElementType) * NumInlineElements];
1057 ElementType* GetInlineElements()
const
1059 return (ElementType*)InlineData;
1066template <u
int32 NumInlineElements,
int IndexSize,
typename SecondaryAllocator>
1072template <u
int32 NumInlineElements,
typename SecondaryAllocator = FDefaultAllocator>
1075template <u
int32 NumInlineElements,
typename SecondaryAllocator = FDefaultAllocator64>
1085template <u
int32 NumInlineElements>
1094 template<
typename ElementType>
1100 : Data(GetInlineElements())
1102 static_assert(
alignof(ElementType) <=
__STDCPP_DEFAULT_NEW_ALIGNMENT__,
"TNonRelocatableInlineAllocator uses GMalloc's default alignment, which is lower than the element type's alignment - please consider a different approach");
1109#if UE_ENABLE_ARRAY_SLACK_TRACKING
1110 FArraySlackTrackingHeader::Free(Data);
1128#if UE_ENABLE_ARRAY_SLACK_TRACKING
1129 FArraySlackTrackingHeader::Free(Data);
1135 if (
Other.HasAllocation())
1142 Data = GetInlineElements();
1159 if(
NewMax <= NumInlineElements)
1165#if UE_ENABLE_ARRAY_SLACK_TRACKING
1166 FArraySlackTrackingHeader::Free(Data);
1170 Data = GetInlineElements();
1178#if UE_ENABLE_ARRAY_SLACK_TRACKING
1179 Data = (ElementType*)FArraySlackTrackingHeader::Realloc(Data, (
int32)
NewMax, (
int32)NumBytesPerElement, 0);
1181 Data = (ElementType*)FMemory::Realloc(Data,
NewMax*NumBytesPerElement);
1187#if UE_ENABLE_ARRAY_SLACK_TRACKING
1188 Data = (ElementType*)FArraySlackTrackingHeader::Realloc(
nullptr, (
int32)
NewMax, (
int32)NumBytesPerElement, 0);
1190 Data = (ElementType*)FMemory::Realloc(
nullptr,
NewMax*NumBytesPerElement);
1219 return HasAllocation() ? (CurrentMax * NumBytesPerElement) : 0;
1224 return Data != GetInlineElements();
1229 return NumInlineElements;
1232#if UE_ENABLE_ARRAY_SLACK_TRACKING
1257 return (ElementType*)InlineData;
1264template <u
int32 NumInlineElements>
1274template <u
int32 NumInlineElements>
1284 template<
typename ElementType>
1310 return GetInlineElements();
1323 return NumInlineElements;
1328 check(CurrentMax <= NumInlineElements);
1329 return NumInlineElements;
1335 return NumInlineElements;
1350 return NumInlineElements;
1361 ElementType* GetInlineElements()
const
1363 return (ElementType*)InlineData;
1371#define NumBitsPerDWORD ((int32)32)
1372#define NumBitsPerDWORDLogTwo ((int32)5)
1381template<
typename InElementAllocator = FDefaultAllocator,
typename InBitArrayAllocator = FDefaultBitArrayAllocator>
1390template <u
int32 Alignment = DEFAULT_ALIGNMENT,
typename InElementAllocator = TAlignedHeapAllocator<Alignment>,
typename InBitArrayAllocator = FDefaultBitArrayAllocator>
1400 uint32 NumInlineElements,
1417template <u
int32 NumInlineElements>
1437 template <u
int32 NumInlineElements,
int32 ElementSize>
1438 constexpr int32 CalculateRequiredBytes()
1440 constexpr uint32 TypeSize = 1 + (NumInlineElements > 0xff) + (NumInlineElements > 0xffff) * 2;
1442 return Align(NumInlineElements*ElementSize, 4) + 4 + (NumInlineElements + HashSize) * TypeSize;
1447template<
typename InElementAllocator = FDefaultAllocator>
1451 template <
typename ElementType>
1457 template<
int32 ElementSize>
1461template<
typename InElementAllocator>
1471template<u
int32 NumInlineElements,
typename SecondaryAllocator = TCompactSetAllocator<>>
1474 template<
int32 ElementSize>
1478 template <
typename ElementType>
1488template <u
int32 NumInlineElements>
1491 template<
int32 ElementSize>
1495 template <
typename ElementType>
1510#if !defined(DEFAULT_NUMBER_OF_ELEMENTS_PER_HASH_BUCKET)
1511# define DEFAULT_NUMBER_OF_ELEMENTS_PER_HASH_BUCKET 2
1513#define DEFAULT_BASE_NUMBER_OF_HASH_BUCKETS 8
1514#define DEFAULT_MIN_NUMBER_OF_HASHED_ELEMENTS 4
1551 TAllocatorTraitsBase<TSparseSetAllocator<InSparseArrayAllocator, InHashAllocator, AverageNumberOfElementsPerHashBucket, BaseNumberOfHashBuckets, MinNumberOfHashedElements>>
1561 uint32 NumInlineElements,
1572 static_assert(NumInlineHashBuckets > 0 && !(NumInlineHashBuckets & (NumInlineHashBuckets - 1)),
"Number of inline buckets must be a power of two");
1582 return NumInlineHashBuckets;
1587 return NumInlineHashBuckets;
1599 uint32 NumInlineElements,
1609 static_assert(NumInlineHashBuckets > 0 && !(NumInlineHashBuckets & (NumInlineHashBuckets - 1)),
"Number of inline buckets must be a power of two");
1619 return NumInlineHashBuckets;
1624 return NumInlineHashBuckets;
1647#ifndef UE_USE_COMPACT_SET_AS_DEFAULT
1648#define UE_USE_COMPACT_SET_AS_DEFAULT 0
1651#if UE_USE_COMPACT_SET_AS_DEFAULT
1653template<
typename InSparseArrayAllocator = TSparseArrayAllocator<>,
typename InHashAllocator = TInlineAllocator<1,FDefaultAllocator>, u
int32... N>
1655template <u
int32 N,
typename S = TCompactSetAllocator<>, u
int32... NN>
1661template<
typename InSparseArrayAllocator = TSparseArrayAllocator<>,
typename InHashAllocator = TInlineAllocator<1,FDefaultAllocator>, u
int32... N>
1663template<u
int32 N,
typename S = TSparseSetAllocator<TSparseArrayAllocator<FDefaultAllocator,FDefaultAllocator>,FDefaultAllocator>, u
int32... NN>
1677template <
typename InElementAllocator,
typename InBitArrayAllocator>
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
UE_FORCEINLINE_HINT SizeType DefaultCalculateSlackReserve(SizeType NewMax, SIZE_T BytesPerElement, bool bAllowQuantize, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition ContainerAllocationPolicies.h:223
#define NumBitsPerDWORD
Definition ContainerAllocationPolicies.h:1371
#define DEFAULT_MIN_NUMBER_OF_HASHED_ELEMENTS
Definition ContainerAllocationPolicies.h:1514
#define UE_CONTAINER_SLACK_GROWTH_FACTOR_DENOMINATOR
Definition ContainerAllocationPolicies.h:132
#define UE_CONTAINER_SLACK_GROWTH_FACTOR_NUMERATOR
Definition ContainerAllocationPolicies.h:124
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
@ INDEX_NONE
Definition CoreMiscDefines.h:150
EConstEval
Definition CoreMiscDefines.h:161
@ ConstEval
Definition CoreMiscDefines.h:161
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ DEFAULT_ALIGNMENT
Definition MemoryBase.h:24
#define MAX_int32
Definition NumericLimits.h:25
Definition ContainerAllocationPolicies.h:284
Definition ContainerAllocationPolicies.h:267
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:276
int32 SizeType
Definition ContainerAllocationPolicies.h:270
ForElementType< FScriptContainerElement > ForAnyElementType
Definition ContainerAllocationPolicies.h:435
@ NeedsElementType
Definition ContainerAllocationPolicies.h:273
Definition ContainerAllocationPolicies.h:1644
TInlineAllocator< 4 > Typedef
Definition ContainerAllocationPolicies.h:1644
Definition ContainerAllocationPolicies.h:1643
TCompactSetAllocator Typedef
Definition ContainerAllocationPolicies.h:1643
Definition ContainerAllocationPolicies.h:1660
TSparseSetAllocator Typedef
Definition ContainerAllocationPolicies.h:1660
Definition ContainerAllocationPolicies.h:1645
TSparseArrayAllocator Typedef
Definition ContainerAllocationPolicies.h:1645
Definition ContainerAllocationPolicies.h:1642
TSparseSetAllocator Typedef
Definition ContainerAllocationPolicies.h:1642
Definition OutputDevice.h:133
Definition ContainerAllocationPolicies.h:455
SizeType GetInitialCapacity() const
Definition ContainerAllocationPolicies.h:550
UE_FORCEINLINE_HINT ~ForAnyElementType()
Definition ContainerAllocationPolicies.h:486
ForAnyElementType()
Definition ContainerAllocationPolicies.h:459
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:540
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition ContainerAllocationPolicies.h:503
bool HasAllocation() const
Definition ContainerAllocationPolicies.h:545
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:535
UE_FORCEINLINE_HINT FScriptContainerElement * GetAllocation() const
Definition ContainerAllocationPolicies.h:499
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:527
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:531
UE_FORCEINLINE_HINT void MoveToEmpty(ForAnyElementType &Other)
Definition ContainerAllocationPolicies.h:468
Definition ContainerAllocationPolicies.h:579
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition ContainerAllocationPolicies.h:589
ForElementType()
Definition ContainerAllocationPolicies.h:584
Definition ContainerAllocationPolicies.h:447
@ NeedsElementType
Definition ContainerAllocationPolicies.h:451
int32 SizeType
Definition ContainerAllocationPolicies.h:449
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:452
Definition ContainerAllocationPolicies.h:1392
InElementAllocator ElementAllocator
Definition ContainerAllocationPolicies.h:1394
InBitArrayAllocator BitArrayAllocator
Definition ContainerAllocationPolicies.h:1395
Definition ContainerAllocationPolicies.h:1286
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1325
bool HasAllocation() const
Definition ContainerAllocationPolicies.h:1343
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1319
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1331
ForElementType()
Definition ContainerAllocationPolicies.h:1290
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition ContainerAllocationPolicies.h:1313
SizeType GetInitialCapacity() const
Definition ContainerAllocationPolicies.h:1348
UE_FORCEINLINE_HINT void MoveToEmpty(ForElementType &Other)
Definition ContainerAllocationPolicies.h:1299
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition ContainerAllocationPolicies.h:1308
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1338
Definition ContainerAllocationPolicies.h:1276
int32 SizeType
Definition ContainerAllocationPolicies.h:1278
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:1281
@ NeedsElementType
Definition ContainerAllocationPolicies.h:1280
void ForAnyElementType
Definition ContainerAllocationPolicies.h:1367
@ ShrinkByDefault
Definition ContainerAllocationPolicies.h:1282
Definition ContainerAllocationPolicies.h:1666
TFixedSparseSetAllocator< N... > Typedef
Definition ContainerAllocationPolicies.h:1666
Definition ContainerAllocationPolicies.h:1419
TFixedAllocator< NumInlineElements > ElementAllocator
Definition ContainerAllocationPolicies.h:1427
TFixedAllocator< InlineBitArrayDWORDs > BitArrayAllocator
Definition ContainerAllocationPolicies.h:1428
Definition ContainerAllocationPolicies.h:1604
static UE_FORCEINLINE_HINT uint32 GetNumberOfHashBuckets(uint32 NumHashedElements)
Definition ContainerAllocationPolicies.h:1614
Definition ContainerAllocationPolicies.h:1664
TInlineSparseSetAllocator< N, S, NN... > Typedef
Definition ContainerAllocationPolicies.h:1664
Definition ContainerAllocationPolicies.h:1404
TInlineAllocator< NumInlineElements, typename SecondaryAllocator::ElementAllocator > ElementAllocator
Definition ContainerAllocationPolicies.h:1412
TInlineAllocator< InlineBitArrayDWORDs, typename SecondaryAllocator::BitArrayAllocator > BitArrayAllocator
Definition ContainerAllocationPolicies.h:1413
Definition ContainerAllocationPolicies.h:1567
static UE_FORCEINLINE_HINT uint32 GetNumberOfHashBuckets(uint32 NumHashedElements)
Definition ContainerAllocationPolicies.h:1577
Definition ContainerAllocationPolicies.h:1096
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1199
SizeType GetInitialCapacity() const
Definition ContainerAllocationPolicies.h:1227
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition ContainerAllocationPolicies.h:1148
UE_FORCEINLINE_HINT bool HasAllocation() const
Definition ContainerAllocationPolicies.h:1222
ForElementType()
Definition ContainerAllocationPolicies.h:1099
~ForElementType()
Definition ContainerAllocationPolicies.h:1105
UE_FORCEINLINE_HINT void MoveToEmpty(ForElementType &Other)
Definition ContainerAllocationPolicies.h:1122
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1217
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1205
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1211
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition ContainerAllocationPolicies.h:1153
Definition ContainerAllocationPolicies.h:1087
int32 SizeType
Definition ContainerAllocationPolicies.h:1089
@ NeedsElementType
Definition ContainerAllocationPolicies.h:1091
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:1092
void ForAnyElementType
Definition ContainerAllocationPolicies.h:1261
Definition ContainerAllocationPolicies.h:1662
TSparseSetAllocator< InSparseArrayAllocator, InHashAllocator, N... > Typedef
Definition ContainerAllocationPolicies.h:1662
Definition ContainerAllocationPolicies.h:830
TSizedHeapAllocator< IndexSize > Typedef
Definition ContainerAllocationPolicies.h:830
Definition ContainerAllocationPolicies.h:631
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement, uint32 AlignmentOfElement)
Definition ContainerAllocationPolicies.h:725
constexpr SizeType GetInitialCapacity() const
Definition ContainerAllocationPolicies.h:785
UE_FORCEINLINE_HINT FScriptContainerElement * GetAllocation() const
Definition ContainerAllocationPolicies.h:696
bool HasAllocation() const
Definition ContainerAllocationPolicies.h:780
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:758
consteval ForAnyElementType(EConstEval)
Definition ContainerAllocationPolicies.h:642
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:750
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:766
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement, uint32 AlignmentOfElement) const
Definition ContainerAllocationPolicies.h:754
UE_FORCEINLINE_HINT void MoveToEmpty(ForAnyElementType &Other)
Definition ContainerAllocationPolicies.h:677
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition ContainerAllocationPolicies.h:700
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement, uint32 AlignmentOfElement) const
Definition ContainerAllocationPolicies.h:770
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement, uint32 AlignmentOfElement) const
Definition ContainerAllocationPolicies.h:762
UE_FORCEINLINE_HINT ~ForAnyElementType()
Definition ContainerAllocationPolicies.h:683
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:775
constexpr ForAnyElementType()
Definition ContainerAllocationPolicies.h:637
UE_FORCEINLINE_HINT void MoveToEmptyFromOtherAllocator(typename OtherAllocator::ForAnyElementType &Other)
Definition ContainerAllocationPolicies.h:653
Definition ContainerAllocationPolicies.h:814
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition ContainerAllocationPolicies.h:823
consteval ForElementType(EConstEval)
Definition ContainerAllocationPolicies.h:818
Definition ContainerAllocationPolicies.h:618
BaseMallocType BaseMalloc
Definition ContainerAllocationPolicies.h:621
@ NeedsElementType
Definition ContainerAllocationPolicies.h:627
typename TBitsToSizeType< IndexSize >::Type SizeType
Definition ContainerAllocationPolicies.h:620
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:628
Definition ContainerAllocationPolicies.h:906
bool HasAllocation() const
Definition ContainerAllocationPolicies.h:1026
UE_FORCEINLINE_HINT ElementType * GetAllocation() const
Definition ContainerAllocationPolicies.h:948
UE_FORCEINLINE_HINT SizeType CalculateSlackGrow(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1006
UE_FORCEINLINE_HINT void MoveToEmpty(ForElementType &Other)
Definition ContainerAllocationPolicies.h:932
UE_FORCEINLINE_HINT SizeType CalculateSlackReserve(SizeType NewMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:992
constexpr SizeType GetInitialCapacity() const
Definition ContainerAllocationPolicies.h:1031
SIZE_T GetAllocatedSize(SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:1017
consteval ForElementType(EConstEval)
Definition ContainerAllocationPolicies.h:921
void ResizeAllocation(SizeType CurrentNum, SizeType NewMax, SIZE_T NumBytesPerElement)
Definition ContainerAllocationPolicies.h:957
UE_FORCEINLINE_HINT SizeType CalculateSlackShrink(SizeType NewMax, SizeType CurrentMax, SIZE_T NumBytesPerElement) const
Definition ContainerAllocationPolicies.h:999
constexpr ForElementType()
Definition ContainerAllocationPolicies.h:910
Definition ContainerAllocationPolicies.h:894
@ RequireRangeCheck
Definition ContainerAllocationPolicies.h:901
void ForAnyElementType
Definition ContainerAllocationPolicies.h:1063
@ NeedsElementType
Definition ContainerAllocationPolicies.h:900
@ ShrinkByDefault
Definition ContainerAllocationPolicies.h:902
typename TBitsToSizeType< IndexSize >::Type SizeType
Definition ContainerAllocationPolicies.h:896
Definition ContainerAllocationPolicies.h:835
@ ShrinkByDefault
Definition ContainerAllocationPolicies.h:838
TSizedHeapAllocator< IndexSize > Typedef
Definition ContainerAllocationPolicies.h:837
Definition ContainerAllocationPolicies.h:1383
InBitArrayAllocator BitArrayAllocator
Definition ContainerAllocationPolicies.h:1387
InElementAllocator ElementAllocator
Definition ContainerAllocationPolicies.h:1386
Definition ContainerAllocationPolicies.h:1525
InHashAllocator HashAllocator
Definition ContainerAllocationPolicies.h:1540
InSparseArrayAllocator SparseArrayAllocator
Definition ContainerAllocationPolicies.h:1539
static UE_FORCEINLINE_HINT uint32 GetNumberOfHashBuckets(uint32 NumHashedElements)
Definition ContainerAllocationPolicies.h:1529
Definition ContainerAllocationPolicies.h:875
Definition ContainerAllocationPolicies.h:1436
implementation
Definition PlayInEditorLoadingScope.h:8
consteval bool ShrinkByDefaultOr()
Definition ContainerAllocationPolicies.h:879
static FORCENOINLINE CORE_API void Free(void *Original)
Definition UnrealMemory.cpp:685
static FORCENOINLINE CORE_API SIZE_T QuantizeSize(SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
Definition UnrealMemory.cpp:700
Definition ContainerAllocationPolicies.h:242
Definition ContainerAllocationPolicies.h:247
@ SupportsElementAlignment
Definition ContainerAllocationPolicies.h:250
@ SupportsSlackTracking
Definition ContainerAllocationPolicies.h:251
@ SupportsFreezeMemoryImage
Definition ContainerAllocationPolicies.h:249
@ IsZeroConstruct
Definition ContainerAllocationPolicies.h:248
Definition ContainerAllocationPolicies.h:256
int16 Type
Definition ContainerAllocationPolicies.h:611
int32 Type
Definition ContainerAllocationPolicies.h:612
int64 Type
Definition ContainerAllocationPolicies.h:613
int8 Type
Definition ContainerAllocationPolicies.h:610
Definition ContainerAllocationPolicies.h:605
Definition ContainerAllocationPolicies.h:261
@ Value
Definition ContainerAllocationPolicies.h:262
Definition ContainerAllocationPolicies.h:1453
static constexpr size_t Value
Definition ContainerAllocationPolicies.h:1454
Definition ContainerAllocationPolicies.h:1449
InElementAllocator ElementAllocator
Definition ContainerAllocationPolicies.h:1458
Definition ContainerAllocationPolicies.h:1497
static constexpr size_t AllocatorAlignof
Definition ContainerAllocationPolicies.h:1499
static constexpr size_t ElementAlignof
Definition ContainerAllocationPolicies.h:1498
static constexpr size_t Value
Definition ContainerAllocationPolicies.h:1500
Definition ContainerAllocationPolicies.h:1490
Definition ContainerAllocationPolicies.h:1480
static constexpr size_t AllocatorAlignof
Definition ContainerAllocationPolicies.h:1482
static constexpr size_t Value
Definition ContainerAllocationPolicies.h:1483
static constexpr size_t ElementAlignof
Definition ContainerAllocationPolicies.h:1481
Definition ContainerAllocationPolicies.h:1473
Definition NumericLimits.h:41
Definition TypeCompatibleBytes.h:24