Navigation
API > API/Runtime > API/Runtime/Core
A thread-safe linear allocator backed by virtual memory.
Reserves address space in one block of ReserveSize and commits pages on demand.
Memory is decommitted by Reset() or when AddRef()/Release() are used to track references to the allocator and that reference count drops to 0.
Reserved memory is released by the destructor. Use TNoDestroy to avoid freeing.
| Name | TVirtualLinearAllocator |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Memory/VirtualLinearAllocator.h |
| Include Path | #include "Memory/VirtualLinearAllocator.h" |
Syntax
template<typename MutexType>
class TVirtualLinearAllocator
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TVirtualLinearAllocator
(
SIZE_T InReserveSize |
ReserveSize must be a multiple of commit alignment. | Memory/VirtualLinearAllocator.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TVirtualLinearAllocator() |
Memory/VirtualLinearAllocator.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FVirtualMemoryBlock | FPlatformMemory::FPlatformVirtualMemoryBlock | Memory/VirtualLinearAllocator.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveCount | std::atomic< uint32 > | Memory/VirtualLinearAllocator.h | ||
| Block | FVirtualMemoryBlock | Memory/VirtualLinearAllocator.h | ||
| CommitSize | SIZE_T | Memory/VirtualLinearAllocator.h | ||
| Mutex | MutexType | Memory/VirtualLinearAllocator.h | ||
| Offset | SIZE_T | Memory/VirtualLinearAllocator.h | ||
| ReserveSize | SIZE_T | Memory/VirtualLinearAllocator.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddRef() |
Memory/VirtualLinearAllocator.h | ||
void * Allocate
(
SIZE_T Size, |
Memory/VirtualLinearAllocator.h | ||
void Release() |
Memory/VirtualLinearAllocator.h | ||
void Reset() |
Memory/VirtualLinearAllocator.h |