UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Allocator.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "uLang/Common/Templates/Storage.h" // for TTypeCompatibleBytes<>
8#include "uLang/Common/Memory/MemoryOps.h" // for RelocateConstructElements<>
9
10namespace uLang
11{
12
18
22{
23 constexpr uint32_t ReversedPolynomial = 0xedb88320u; // The bit-reversed version of the famous 0x04c11db7 (posix etc.)
24 uint32_t CRCShifted = CRC >> 1;
25 return (CRC & 1) ? CRCShifted ^ ReversedPolynomial : CRCShifted;
26}
27
35{
36public:
37 using FAllocate = void * (*)(const CAllocatorInstance *, size_t);
38 using FReallocate = void * (*)(const CAllocatorInstance *, void *, size_t);
39 using FDeallocate = void (*)(const CAllocatorInstance *, void *);
40
43 : _Allocate(Allocate), _Reallocate(Reallocate), _Deallocate(Deallocate), _ObserverIdGenerator(EObserverId(uintptr_t(this) | 1)) {}
44
45 ULANG_FORCEINLINE void * Allocate(size_t NumBytes) const { return (*_Allocate)(this, NumBytes); }
46 ULANG_FORCEINLINE void * Reallocate(void * Memory, size_t NumBytes) const { return (*_Reallocate)(this, Memory, NumBytes); }
47 ULANG_FORCEINLINE void Deallocate(void * Memory) const { (*_Deallocate)(this, Memory); }
48
49 ULANG_FORCEINLINE EObserverId GenerateObserverId() { return EObserverId(_ObserverIdGenerator = RotateCRC32(_ObserverIdGenerator)); }
50
51private:
52 FAllocate _Allocate;
53 FReallocate _Reallocate;
54 FDeallocate _Deallocate;
55
58 uint32_t _ObserverIdGenerator;
59};
60
61
64{
65public:
68
69 ULANG_FORCEINLINE static void * Allocate(size_t NumBytes) { return GetSystemParams()._HeapMalloc(NumBytes); }
70 ULANG_FORCEINLINE static void * Reallocate(void * Memory, size_t NumBytes) { return GetSystemParams()._HeapRealloc(Memory, NumBytes); }
72
74 {
75 static volatile uint32_t ObserverIdGenerator(0xdeadbeefu);
76 uint32_t CRC, NewCRC;
77 do
78 {
80 NewCRC = RotateCRC32(CRC);
82 return EObserverId(NewCRC);
83 }
84
86 bool operator == (const CHeapRawAllocator& Other) const { return true; }
87 bool operator != (const CHeapRawAllocator& Other) const { return false; }
88};
89
92{
93public:
95 ULANG_FORCEINLINE CInstancedRawAllocator(EDefaultInit) : _AllocatorInstance(nullptr) {} // Requires explicit argument to prevent default initialization by simply passing no arguments
96
97 ULANG_FORCEINLINE void * Allocate(size_t NumBytes) const { return _AllocatorInstance->Allocate(NumBytes); }
98 ULANG_FORCEINLINE void * Reallocate(void * Memory, size_t NumBytes) { return _AllocatorInstance->Reallocate(Memory, NumBytes); }
100
102
104};
105
106}
107
108// Operators new and delete must be defined outside of any namespace
109
110// Deliberately NOT implementing new[] and delete[] here
111ULANG_FORCEINLINE void * operator new(size_t NumBytes, const ::uLang::CHeapRawAllocator & Allocator) { return Allocator.Allocate(NumBytes); }
112// Unfortunately, C++ does not have a clean syntax to invoke custom delete operators so this is a bit useless...
113ULANG_FORCEINLINE void operator delete(void * Memory, const ::uLang::CHeapRawAllocator & Allocator) { Allocator.Deallocate(Memory); }
114
115// Deliberately NOT implementing new[] and delete[] here
116ULANG_FORCEINLINE void * operator new(size_t NumBytes, const ::uLang::CInstancedRawAllocator & Allocator) { return Allocator.Allocate(NumBytes); }
117// Unfortunately, C++ does not have a clean syntax to invoke custom delete operators so this is a bit useless...
118ULANG_FORCEINLINE void operator delete(void * Memory, const ::uLang::CInstancedRawAllocator & Allocator) { Allocator.Deallocate(Memory); }
119
120namespace uLang
121{
122
123enum
124{
125 // Default allocator alignment. If the default is specified, the allocator applies to engine rules.
126 // Blocks >= 16 bytes will be 16-byte-aligned, Blocks < 16 will be 8-byte aligned. If the allocator does
127 // not support allocation alignment, the alignment will be ignored.
129
130 // Minimum allocator alignment
132};
133
138{
139 return Count;
140}
141
142ULANG_FORCEINLINE int32_t DefaultCalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, size_t BytesPerElement, bool bAllowQuantize, uint32_t Alignment = DEFAULT_ALIGNMENT)
143{
145 ULANG_ASSERTF(NumElements < NumAllocatedElements, "Invalid shrink parameters.");
146
147 // If the container has too much slack, shrink it to exactly fit the number of elements.
148 const uint32_t CurrentSlackElements = NumAllocatedElements - NumElements;
149 const size_t CurrentSlackBytes = (NumAllocatedElements - NumElements)*BytesPerElement;
150 const bool bTooManySlackBytes = CurrentSlackBytes >= 16384;
151 const bool bTooManySlackElements = 3 * NumElements < 2 * NumAllocatedElements;
152 if ((bTooManySlackBytes || bTooManySlackElements) && (CurrentSlackElements > 64 || !NumElements)) // hard coded 64 :-(
153 {
154 Retval = NumElements;
155 if (Retval > 0)
156 {
157 if (bAllowQuantize)
158 {
159 Retval = int32_t(DefaultQuantizeSize(Retval * BytesPerElement, Alignment) / BytesPerElement);
160 }
161 }
162 }
163 else
164 {
165 Retval = NumAllocatedElements;
166 }
167
168 return Retval;
169}
170
171ULANG_FORCEINLINE int32_t DefaultCalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, size_t BytesPerElement, bool bAllowQuantize, uint32_t Alignment = DEFAULT_ALIGNMENT)
172{
173#if ULANG_AGGRESSIVE_MEMORY_SAVING
174 const size_t FirstGrow = 1;
175 const size_t ConstantGrow = 0;
176#else
177 const size_t FirstGrow = 4;
178 const size_t ConstantGrow = 16;
179#endif
180
182 ULANG_ASSERTF(NumElements > NumAllocatedElements && NumElements > 0, "Invalid grow parameters.");
183
184 size_t Grow = FirstGrow; // this is the amount for the first alloc
185 if (NumAllocatedElements || size_t(NumElements) > Grow)
186 {
187 // Allocate slack for the array proportional to its size.
188 Grow = size_t(NumElements) + 3 * size_t(NumElements) / 8 + ConstantGrow;
189 }
190 if (bAllowQuantize)
191 {
192 Retval = int32_t(DefaultQuantizeSize(Grow * BytesPerElement, Alignment) / BytesPerElement);
193 }
194 else
195 {
197 }
198 // NumElements and MaxElements are stored in 32 bit signed integers so we must be careful not to overflow here.
199 if (NumElements > Retval)
200 {
202 }
203
204 return Retval;
205}
206
208{
209 int32_t Retval = NumElements;
210 ULANG_ASSERTF(NumElements > 0, "Invalid reserve parameters.");
211 if (bAllowQuantize)
212 {
213 Retval = int32_t(DefaultQuantizeSize(size_t(Retval) * size_t(BytesPerElement), Alignment) / BytesPerElement);
214 // NumElements and MaxElements are stored in 32 bit signed integers so we must be careful not to overflow here.
215 if (NumElements > Retval)
216 {
218 }
219 }
220
221 return Retval;
222}
223
226{
227};
228
229template <typename AllocatorType>
231{
232 enum { SupportsMove = false };
233 enum { IsZeroConstruct = false };
234};
235
236template <typename AllocatorType>
238{
239};
240
241
243template<class InRawAllocatorType, typename... AllocatorArgsType>
245{
246public:
247
249
250 enum { NeedsElementType = false };
251 enum { RequireRangeCheck = true };
252
258 {
259 public:
261 ULANG_FORCEINLINE ForAnyElementType(EDefaultInit) : _Data(nullptr), _RawAllocator(DefaultInit) {}
262
264 ULANG_FORCEINLINE ForAnyElementType(const RawAllocatorType & Allocator) : _Data(nullptr), _RawAllocator(Allocator) {}
266
273 {
274 ULANG_ASSERTF(this != &Other, "Must not move data onto itself.");
275
276 if (_Data)
277 {
278 _RawAllocator.Deallocate(_Data);
279 }
280
281 _Data = Other._Data;
282 _RawAllocator = Other._RawAllocator;
283 Other._Data = nullptr;
284 }
285
288 {
289 if (_Data)
290 {
291 _RawAllocator.Deallocate(_Data);
292 }
293 }
294
297 {
298 return _Data;
299 }
300
303 {
304 return _RawAllocator;
305 }
306
313 ULANG_FORCEINLINE void ResizeAllocation(int32_t PreviousNumElements, int32_t NumElements, size_t NumBytesPerElement)
314 {
315 // Avoid calling FMemory::Realloc( nullptr, 0 ) as ANSI C mandates returning a valid pointer which is not what we want.
316 if (_Data || NumElements)
317 {
318 //ULANG_ASSERTF(((uint64_t)NumElements*(uint64_t)ElementTypeInfo.GetSize() < (uint64_t)INT_MAX));
319 size_t NumBytes = NumElements * NumBytesPerElement;
320 _Data = _Data
321 ? (SScriptContainerElement*)_RawAllocator.Reallocate( _Data, NumBytes )
322 : (SScriptContainerElement*)_RawAllocator.Allocate( NumBytes );
323 }
324 }
325
332 ULANG_FORCEINLINE int32_t CalculateSlackReserve(int32_t NumElements, int32_t NumBytesPerElement) const
333 {
334 return DefaultCalculateSlackReserve(NumElements, NumBytesPerElement, true);
335 }
336
343 ULANG_FORCEINLINE int32_t CalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
344 {
345 return DefaultCalculateSlackShrink(NumElements, NumAllocatedElements, NumBytesPerElement, true);
346 }
347
354 ULANG_FORCEINLINE int32_t CalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
355 {
356 return DefaultCalculateSlackGrow(NumElements, NumAllocatedElements, NumBytesPerElement, true);
357 }
358
359 ULANG_FORCEINLINE size_t GetAllocatedSize(int32_t NumAllocatedElements, size_t NumBytesPerElement) const
360 {
361 return NumAllocatedElements * NumBytesPerElement;
362 }
363
365 {
366 return !!_Data;
367 }
368
369 private:
370 ForAnyElementType(const ForAnyElementType &) = delete;
371 ForAnyElementType& operator=(const ForAnyElementType &) = delete;
372
375
378 RawAllocatorType _RawAllocator;
379 };
380
385 template<typename ElementType>
399};
400
401template<class RawAllocatorType>
402struct TAllocatorTraits<TDefaultElementAllocator<RawAllocatorType>> : TAllocatorTraitsBase<TDefaultElementAllocator<RawAllocatorType>>
403{
404 enum { SupportsMove = true };
405 enum { IsZeroConstruct = true };
406};
407
412template <uint32_t NumInlineElements, typename SecondaryAllocator = TDefaultElementAllocator<CHeapRawAllocator>, typename... AllocatorArgsType>
414{
415public:
416
417 using RawAllocatorType = typename SecondaryAllocator::RawAllocatorType;
418
419 enum { NeedsElementType = true };
420 enum { RequireRangeCheck = true };
421
422 template<typename ElementType>
424 {
425 public:
426
431
435
442 {
443 ULANG_ASSERTF(this != &Other, "Must not move data onto itself.");
444
445 if (!Other._SecondaryData.GetAllocation())
446 {
447 // Relocate objects from other inline storage only if it was stored inline in Other
448 RelocateConstructElements<ElementType>((void*)InlineData, Other.GetInlineElements(), NumInlineElements);
449 }
450
451 // Move secondary storage in any case.
452 // This will move secondary storage if it exists but will also handle the case where secondary storage is used in Other but not in *this.
453 _SecondaryData.MoveToEmpty(Other._SecondaryData);
454 }
455
456 ULANG_FORCEINLINE ElementType* GetAllocation() const
457 {
458 return _SecondaryData.GetAllocation() ? _SecondaryData.GetAllocation() : GetInlineElements();
459 }
460
463 {
464 return _SecondaryData.GetRawAllocator();
465 }
466
467 ULANG_FORCEINLINE void ResizeAllocation(int32_t PreviousNumElements, int32_t NumElements, size_t NumBytesPerElement)
468 {
469 // Check if the new allocation will fit in the inline data area.
470 if (uint32_t(NumElements) <= NumInlineElements)
471 {
472 // If the old allocation wasn't in the inline data area, relocate it into the inline data area.
473 if (_SecondaryData.GetAllocation())
474 {
475 RelocateConstructElements<ElementType>((void*)InlineData, (ElementType*)_SecondaryData.GetAllocation(), PreviousNumElements);
476
477 // Free the old indirect allocation.
478 _SecondaryData.ResizeAllocation(0, 0, NumBytesPerElement);
479 }
480 }
481 else
482 {
483 if (!_SecondaryData.GetAllocation())
484 {
485 // Allocate new indirect memory for the data.
486 _SecondaryData.ResizeAllocation(0, NumElements, NumBytesPerElement);
487
488 // Move the data out of the inline data area into the new allocation.
489 RelocateConstructElements<ElementType>((void*)_SecondaryData.GetAllocation(), GetInlineElements(), PreviousNumElements);
490 }
491 else
492 {
493 // Reallocate the indirect data for the new size.
494 _SecondaryData.ResizeAllocation(PreviousNumElements, NumElements, NumBytesPerElement);
495 }
496 }
497 }
498
499 ULANG_FORCEINLINE int32_t CalculateSlackReserve(int32_t NumElements, int32_t NumBytesPerElement) const
500 {
501 // If the elements use less space than the inline allocation, only use the inline allocation as slack.
502 return uint32_t(NumElements) <= NumInlineElements ?
503 NumInlineElements :
504 _SecondaryData.CalculateSlackReserve(NumElements, NumBytesPerElement);
505 }
506 ULANG_FORCEINLINE int32_t CalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
507 {
508 // If the elements use less space than the inline allocation, only use the inline allocation as slack.
509 return uint32_t(NumElements) <= NumInlineElements ?
510 NumInlineElements :
511 _SecondaryData.CalculateSlackShrink(NumElements, NumAllocatedElements, NumBytesPerElement);
512 }
513 ULANG_FORCEINLINE int32_t CalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
514 {
515 // If the elements use less space than the inline allocation, only use the inline allocation as slack.
516 return uint32_t(NumElements) <= NumInlineElements ?
517 NumInlineElements :
518 _SecondaryData.CalculateSlackGrow(NumElements, NumAllocatedElements, NumBytesPerElement);
519 }
520
521 ULANG_FORCEINLINE size_t GetAllocatedSize(int32_t NumAllocatedElements, size_t NumBytesPerElement) const
522 {
523 if (uint32_t(NumAllocatedElements) > NumInlineElements)
524 {
525 return _SecondaryData.GetAllocatedSize(NumAllocatedElements, NumBytesPerElement);
526 }
527 return 0;
528 }
529
531 {
532 return _SecondaryData.HasAllocation();
533 }
534
536 {
537 return NumInlineElements;
538 }
539
540 private:
542 ForElementType& operator=(const ForElementType&);
543
545 TTypeCompatibleBytes<ElementType> InlineData[NumInlineElements];
546
548 typename SecondaryAllocator::template ForElementType<ElementType> _SecondaryData;
549
551 ElementType* GetInlineElements() const
552 {
553 return (ElementType*)InlineData;
554 }
555 };
556
557 typedef void ForAnyElementType;
558};
559
560template <uint32_t NumInlineElements, typename SecondaryAllocator>
561struct TAllocatorTraits<TInlineElementAllocator<NumInlineElements, SecondaryAllocator>> : TAllocatorTraitsBase<TInlineElementAllocator<NumInlineElements, SecondaryAllocator>>
562{
564};
565
566}
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ULANG_FORCEINLINE
Definition Common.h:188
#define ULANG_ASSERTF(expr, format,...)
Definition Common.h:290
Definition Allocator.h:35
ULANG_FORCEINLINE void * Reallocate(void *Memory, size_t NumBytes) const
Definition Allocator.h:46
CAllocatorInstance(FAllocate Allocate, FReallocate Reallocate, FDeallocate Deallocate)
Use the memory address of this object to seed the observer id generator.
Definition Allocator.h:42
void *(*)(const CAllocatorInstance *, size_t) FAllocate
Definition Allocator.h:37
ULANG_FORCEINLINE void * Allocate(size_t NumBytes) const
Definition Allocator.h:45
void *(*)(const CAllocatorInstance *, void *, size_t) FReallocate
Definition Allocator.h:38
ULANG_FORCEINLINE void Deallocate(void *Memory) const
Definition Allocator.h:47
ULANG_FORCEINLINE EObserverId GenerateObserverId()
Definition Allocator.h:49
void(*)(const CAllocatorInstance *, void *) FDeallocate
Definition Allocator.h:39
Raw memory allocator that allocates memory from the global heap.
Definition Allocator.h:64
static ULANG_FORCEINLINE void Deallocate(void *Memory)
Definition Allocator.h:71
ULANG_FORCEINLINE CHeapRawAllocator(EDefaultInit)
Definition Allocator.h:67
bool operator!=(const CHeapRawAllocator &Other) const
Definition Allocator.h:87
static ULANG_FORCEINLINE void * Reallocate(void *Memory, size_t NumBytes)
Definition Allocator.h:70
ULANG_FORCEINLINE CHeapRawAllocator()
Definition Allocator.h:66
static ULANG_FORCEINLINE EObserverId GenerateObserverId()
Definition Allocator.h:73
static ULANG_FORCEINLINE void * Allocate(size_t NumBytes)
Definition Allocator.h:69
bool operator==(const CHeapRawAllocator &Other) const
Any instance of this allocator is as good as any other.
Definition Allocator.h:86
Raw memory allocator that keeps a pointer to an allocator instance which is used for allocation.
Definition Allocator.h:92
ULANG_FORCEINLINE CInstancedRawAllocator(EDefaultInit)
Definition Allocator.h:95
ULANG_FORCEINLINE void * Reallocate(void *Memory, size_t NumBytes)
Definition Allocator.h:98
ULANG_FORCEINLINE CInstancedRawAllocator(CAllocatorInstance *AllocatorInstance)
Definition Allocator.h:94
ULANG_FORCEINLINE void Deallocate(void *Memory) const
Definition Allocator.h:99
ULANG_FORCEINLINE void * Allocate(size_t NumBytes) const
Definition Allocator.h:97
ULANG_FORCEINLINE EObserverId GenerateObserverId() const
Definition Allocator.h:101
CAllocatorInstance * _AllocatorInstance
Definition Allocator.h:103
ULANG_FORCEINLINE ForAnyElementType(const RawAllocatorType &Allocator)
Definition Allocator.h:264
ULANG_FORCEINLINE size_t GetAllocatedSize(int32_t NumAllocatedElements, size_t NumBytesPerElement) const
Definition Allocator.h:359
ULANG_FORCEINLINE void ResizeAllocation(int32_t PreviousNumElements, int32_t NumElements, size_t NumBytesPerElement)
Definition Allocator.h:313
ULANG_FORCEINLINE void MoveToEmpty(ForAnyElementType &Other)
Definition Allocator.h:272
ULANG_FORCEINLINE const RawAllocatorType & GetRawAllocator() const
Definition Allocator.h:302
ULANG_FORCEINLINE int32_t CalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
Definition Allocator.h:354
ULANG_FORCEINLINE bool HasAllocation()
Definition Allocator.h:364
ULANG_FORCEINLINE ForAnyElementType(AllocatorArgsType... AllocatorArgs)
Definition Allocator.h:265
ULANG_FORCEINLINE SScriptContainerElement * GetAllocation() const
Definition Allocator.h:296
ULANG_FORCEINLINE ~ForAnyElementType()
Definition Allocator.h:287
ULANG_FORCEINLINE int32_t CalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
Definition Allocator.h:343
ULANG_FORCEINLINE int32_t CalculateSlackReserve(int32_t NumElements, int32_t NumBytesPerElement) const
Definition Allocator.h:332
ULANG_FORCEINLINE ForAnyElementType(EDefaultInit)
Definition Allocator.h:261
ULANG_FORCEINLINE ForElementType(EDefaultInit)
Definition Allocator.h:390
ULANG_FORCEINLINE ForElementType(AllocatorArgsType &&... AllocatorArgs)
Definition Allocator.h:392
ULANG_FORCEINLINE ForElementType(const RawAllocatorType &Allocator)
Definition Allocator.h:391
ULANG_FORCEINLINE ElementType * GetAllocation() const
Definition Allocator.h:394
Definition Allocator.h:245
@ NeedsElementType
Definition Allocator.h:250
InRawAllocatorType RawAllocatorType
Definition Allocator.h:248
@ RequireRangeCheck
Definition Allocator.h:251
ULANG_FORCEINLINE bool HasAllocation() const
Definition Allocator.h:530
ULANG_FORCEINLINE int32_t CalculateSlackReserve(int32_t NumElements, int32_t NumBytesPerElement) const
Definition Allocator.h:499
uint32_t GetInitialCapacity() const
Definition Allocator.h:535
ULANG_FORCEINLINE int32_t CalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
Definition Allocator.h:506
ForElementType(EDefaultInit)
Definition Allocator.h:428
ULANG_FORCEINLINE const RawAllocatorType & GetRawAllocator() const
Definition Allocator.h:462
ULANG_FORCEINLINE size_t GetAllocatedSize(int32_t NumAllocatedElements, size_t NumBytesPerElement) const
Definition Allocator.h:521
ULANG_FORCEINLINE ForElementType(const RawAllocatorType &Allocator)
Definition Allocator.h:433
ULANG_FORCEINLINE void MoveToEmpty(ForElementType &Other)
Definition Allocator.h:441
ULANG_FORCEINLINE ForElementType(AllocatorArgsType... AllocatorArgs)
Definition Allocator.h:434
ULANG_FORCEINLINE int32_t CalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, int32_t NumBytesPerElement) const
Definition Allocator.h:513
ULANG_FORCEINLINE ElementType * GetAllocation() const
Definition Allocator.h:456
ULANG_FORCEINLINE void ResizeAllocation(int32_t PreviousNumElements, int32_t NumElements, size_t NumBytesPerElement)
Definition Allocator.h:467
Definition Allocator.h:414
@ RequireRangeCheck
Definition Allocator.h:420
void ForAnyElementType
Definition Allocator.h:557
typename SecondaryAllocator::RawAllocatorType RawAllocatorType
Definition Allocator.h:417
@ NeedsElementType
Definition Allocator.h:419
Definition VVMEngineEnvironment.h:23
EDefaultInit
Enum used to force default initialization.
Definition Common.h:378
@ DefaultInit
Definition Common.h:378
ULANG_FORCEINLINE uint32_t InterlockedCompareExchange(volatile uint32_t *Value, uint32_t ReplaceWithThis, uint32_t IfEqualToThis)
Definition WindowsThreading.h:10
EObserverId
Id type for observer pointers.
Definition Allocator.h:15
@ ObserverId_Null
Definition Allocator.h:16
SSystemParams & GetSystemParams()
Global variable for efficient access.
Definition Common.cpp:9
ULANG_FORCEINLINE int32_t DefaultCalculateSlackGrow(int32_t NumElements, int32_t NumAllocatedElements, size_t BytesPerElement, bool bAllowQuantize, uint32_t Alignment=DEFAULT_ALIGNMENT)
Definition Allocator.h:171
ULANG_FORCEINLINE int32_t DefaultCalculateSlackShrink(int32_t NumElements, int32_t NumAllocatedElements, size_t BytesPerElement, bool bAllowQuantize, uint32_t Alignment=DEFAULT_ALIGNMENT)
Definition Allocator.h:142
ULANG_FORCEINLINE T && ForwardArg(typename TRemoveReference< T >::Type &Obj)
Definition References.h:115
@ DEFAULT_ALIGNMENT
Definition Allocator.h:128
@ MIN_ALIGNMENT
Definition Allocator.h:131
ULANG_FORCEINLINE int32_t DefaultCalculateSlackReserve(int32_t NumElements, size_t BytesPerElement, bool bAllowQuantize, uint32_t Alignment=DEFAULT_ALIGNMENT)
Definition Allocator.h:207
ULANG_FORCEINLINE size_t DefaultQuantizeSize(size_t Count, uint32_t Alignment)
Definition Allocator.h:137
ULANG_FORCEINLINE uint32_t RotateCRC32(uint32_t CRC)
Definition Allocator.h:21
Definition Allocator.h:226
FRealloc _HeapRealloc
Reallocate system heap memory.
Definition Common.h:414
FFree _HeapFree
Free system heap memory.
Definition Common.h:415
FMalloc _HeapMalloc
Allocate system heap memory.
Definition Common.h:413
Definition Allocator.h:231
@ SupportsMove
Definition Allocator.h:232
@ IsZeroConstruct
Definition Allocator.h:233
Definition Allocator.h:238
Definition Storage.h:106