![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SpanAllocator.h>
Public Member Functions | |
| ENGINE_API | FSpanAllocator (bool bInGrowOnly=false) |
| int32 | Allocate (int32 Num=1) |
| void | Free (int32 BaseOffset, int32 Num=1) |
| ENGINE_API void | Reset () |
| ENGINE_API void | Empty () |
| int32 | GetSparselyAllocatedSize () const |
| int32 | GetMaxSize () const |
| int32 | GetNumFreeSpans () const |
| int32 | GetNumPendingFreeSpans () const |
| SIZE_T | GetAllocatedSize () const |
| ENGINE_API void | Consolidate () |
Allocator for spans from some range that is allowed to grow and shrink to accomodate the allocations. Implementation is biased towards the case where allocations and frees are performed in bulk, if they are interleaved performance will degrade. Prefers allocations at the start of the range, such that the high-watermark can be reduced optimally. Primarily optimized for the use-case where span size == 1, for variable span size allocation performance is sub-optimal as it does not accelerate the search for larger allocs.
If bInGrowOnly is true the size reported by GetMaxSize() will never decrease except when for when Reset() or Empty() is called.
| void FSpanAllocator::Consolidate | ( | ) |
Between these calls to Free just appends the allocation to the free list, rather than trying to merge with existing allocations. At EndDeferMerges the free list is consolidated by sorting and merging all spans. This amortises the cost of the merge over many calls.
| void FSpanAllocator::Empty | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void FSpanAllocator::Reset | ( | ) |