28template<u
int32 AllocationSize, u
int32 BlockSize>
43 static_assert(AllocationSize >=
sizeof(FreeListNode),
"Allocation size must be large enough to hold pointer.");
72 void *
rawMem = (
void *)FreeList;
73 FreeList = FreeList->NextFreeAllocation;
101 return NumAllocated * AllocationSize;
110 if (NumElements == 0)
116 check(AllocationSize*NumElements >=
sizeof(FreeListNode));
125 NewFreeList->NextFreeAllocation = (FreeListNode*)(
RawMem + (i+1)*AllocationSize);
130 FreeList = (FreeListNode*)
RawMem;
132 NumAllocated += NumElements;
139 FreeListNode* NextFreeAllocation;
142 void CheckInvariants()
const
150 FreeListNode* FreeList;
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition AllocatorFixedSizeFreeList.h:30
void Grow(uint32 NumElements)
Definition AllocatorFixedSizeFreeList.h:108
TAllocatorFixedSizeFreeList(uint32 InitialBlockSize=0)
Definition AllocatorFixedSizeFreeList.h:37
void Free(void *Element)
Definition AllocatorFixedSizeFreeList.h:83
~TAllocatorFixedSizeFreeList()
Definition AllocatorFixedSizeFreeList.h:52
void * Allocate()
Definition AllocatorFixedSizeFreeList.h:63
uint32 GetAllocatedSize() const
Definition AllocatorFixedSizeFreeList.h:98