14#include "CoreMinimal.h"
40 enum { NeedsElementType =
false };
41 enum { RequireRangeCheck =
true };
61 check(
this != &other);
63 if (Data) ::free(Data);
72 if (Data) ::free(Data);
83 return DefaultCalculateSlackReserve(newMax, numBytesPerElement,
false);
87 return DefaultCalculateSlackShrink(newMax, currentMax, numBytesPerElement,
false);
91 return DefaultCalculateSlackGrow(newMax, currentMax, numBytesPerElement,
false);
96 return currentMax * numBytesPerElement;
114 FScriptContainerElement* Data;
117 template<
typename ElementType>
128 return (ElementType*)ForAnyElementType::GetAllocation();
134 class FSetAllocator :
public TSetAllocator<FAllocator, TInlineAllocator<1, FAllocator>> {};
142template <
typename T,
typename KeyFuncs = DefaultKeyFuncs<T>>
143using TAnsiSet = TSet<T, KeyFuncs, Mcro::Ansi::FSetAllocator>;
146template <
typename K,
typename V,
typename KeyFuncs = TDefaultMapHashableKeyFuncs<K, V, false>>
147using TAnsiMap = TMap<K, V, Mcro::Ansi::FSetAllocator, KeyFuncs>;
152 enum { IsZeroConstruct =
true };
TArray< T, Mcro::Ansi::FAllocator > TAnsiArray
TArray alias which enforces standard memory allocations.
TMap< K, V, Mcro::Ansi::FSetAllocator, KeyFuncs > TAnsiMap
TMap alias which enforces standard memory allocations.
TSet< T, KeyFuncs, Mcro::Ansi::FSetAllocator > TAnsiSet
TSet alias which enforces standard memory allocations.
SizeType CalculateSlackReserve(SizeType newMax, SIZE_T numBytesPerElement) const
FORCEINLINE void MoveToEmpty(ForAnyElementType &other)
Moves the state of another allocator into this one.
SizeType CalculateSlackShrink(SizeType newMax, SizeType currentMax, SIZE_T numBytesPerElement) const
void ResizeAllocation(SizeType currentNum, SizeType newMax, SIZE_T numBytesPerElement)
FORCEINLINE ~ForAnyElementType()
SizeType GetInitialCapacity() const
FORCEINLINE FScriptContainerElement * GetAllocation() const
bool HasAllocation() const
SIZE_T GetAllocatedSize(SizeType currentMax, SIZE_T numBytesPerElement) const
SizeType CalculateSlackGrow(SizeType newMax, SizeType currentMax, SIZE_T numBytesPerElement) const
FORCEINLINE ElementType * GetAllocation() const
Allocator that allocates memory using standard library functions.
FAllocator ElementAllocator
FAllocator BitArrayAllocator
Allocator for sets to follow standard allocation behavior.
MCRO_API void OnInvalidAnsiAllocatorNum(int32 newNum, SIZE_T numBytesPerElement)
Epic Games may not agree with standards because they know better, but sometimes we have to bare conse...