Navigation
API > API/Runtime > API/Runtime/Core
Thread safe, lock free pooling allocator of fixed size blocks that only returns free space when the allocator is destroyed. Alignment isn't handled; assumes FMemory::Malloc will work.
| Name | TLockFreeFixedSizeAllocator |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/LockFreeFixedSizeAllocator.h |
| Include Path | #include "Containers/LockFreeFixedSizeAllocator.h" |
Syntax
template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter>
class TLockFreeFixedSizeAllocator
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Containers/LockFreeFixedSizeAllocator.h | |||
| Containers/LockFreeFixedSizeAllocator.h | |||
| Containers/LockFreeFixedSizeAllocator.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TLockFreeFixedSizeAllocator() |
Destructor, returns all memory via FMemory::Free | Containers/LockFreeFixedSizeAllocator.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| FreeList | TLockFreePointerListUnordered< void, TPaddingForCacheContention > | Lock free list of free memory blocks. | Containers/LockFreeFixedSizeAllocator.h | |
| NumFree | TTrackingCounter | Total number of blocks in the free list. | Containers/LockFreeFixedSizeAllocator.h | |
| NumUsed | TTrackingCounter | Total number of blocks outstanding and not in the free list. | Containers/LockFreeFixedSizeAllocator.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void * Allocate
(
int32 Alignment |
Allocates a memory block of size SIZE. | Containers/LockFreeFixedSizeAllocator.h | |
void Free
(
void* Item |
Puts a memory block previously obtained from Allocate() back on the free list for future use. | Containers/LockFreeFixedSizeAllocator.h | |
TTrackingCounter::IntegerType GetNumFree () |
Gets the number of allocated memory blocks that are currently unused. | Containers/LockFreeFixedSizeAllocator.h | |
TTrackingCounter::IntegerType GetNumUsed () |
Gets the number of allocated memory blocks that are currently in use. | Containers/LockFreeFixedSizeAllocator.h | |
void Trim() |
Returns all free memory to the heap. | Containers/LockFreeFixedSizeAllocator.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Containers/LockFreeFixedSizeAllocator.h | |||
| Containers/LockFreeFixedSizeAllocator.h |