UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRHIMemoryPool Class Reference

Pool which stores for each allocation the previous and next allocation. Each block is either free or allocated. More...

#include <RHIPoolAllocator.h>

+ Inheritance diagram for FRHIMemoryPool:

Public Types

enum class  EFreeListOrder { SortBySize , SortByOffset }
 

Public Member Functions

RHICORE_API FRHIMemoryPool (int16 InPoolIndex, uint64 InPoolSize, uint32 InPoolAlignment, ERHIPoolResourceTypes InSupportedResourceTypes, EFreeListOrder InFreeListOrder)
 
virtual RHICORE_API ~FRHIMemoryPool ()
 
virtual RHICORE_API void Init ()
 
virtual RHICORE_API void Destroy ()
 
RHICORE_API bool TryAllocate (uint32 InSizeInBytes, uint32 InAllocationAlignment, ERHIPoolResourceTypes InAllocationResourceType, FRHIPoolAllocationData &AllocationData)
 
RHICORE_API void Deallocate (FRHIPoolAllocationData &AllocationData)
 
RHICORE_API void TryClear (FRHIContextArray const &Contexts, FRHIPoolAllocator *InAllocator, uint32 InMaxCopySize, uint32 &CopySize, const TArray< FRHIMemoryPool * > &InTargetPools)
 
int16 GetPoolIndex () const
 
uint64 GetPoolSize () const
 
uint64 GetFreeSize () const
 
uint64 GetUsedSize () const
 
uint32 GetAlignmentWaste () const
 
uint32 GetAllocatedBlocks () const
 
ERHIPoolResourceTypes GetSupportedResourceTypes () const
 
bool IsResourceTypeSupported (ERHIPoolResourceTypes InType) const
 
bool IsEmpty () const
 
bool IsFull () const
 

Static Public Member Functions

static RHICORE_API uint32 GetAlignedSize (uint32 InSizeInBytes, uint32 InPoolAlignment, uint32 InAllocationAlignment)
 
static RHICORE_API uint32 GetAlignedOffset (uint32 InOffset, uint32 InPoolAlignment, uint32 InAllocationAlignment)
 

Protected Member Functions

RHICORE_API int32 FindFreeBlock (uint32 InSizeInBytes, uint32 InAllocationAlignment) const
 
RHICORE_API FRHIPoolAllocationDataAddToFreeBlocks (FRHIPoolAllocationData *InFreeBlock)
 
RHICORE_API void RemoveFromFreeBlocks (FRHIPoolAllocationData *InFreeBlock)
 
RHICORE_API FRHIPoolAllocationDataGetNewAllocationData ()
 
RHICORE_API void ReleaseAllocationData (FRHIPoolAllocationData *InData)
 
RHICORE_API void Validate ()
 

Protected Attributes

int16 PoolIndex
 
const uint64 PoolSize
 
const uint32 PoolAlignment
 
const ERHIPoolResourceTypes SupportedResourceTypes
 
const EFreeListOrder FreeListOrder
 
uint64 FreeSize
 
uint64 AligmnentWaste
 
uint32 AllocatedBlocks
 
FRHIPoolAllocationData HeadBlock
 
TArray< FRHIPoolAllocationData * > FreeBlocks
 
TArray< FRHIPoolAllocationData * > AllocationDataPool
 

Detailed Description

Pool which stores for each allocation the previous and next allocation. Each block is either free or allocated.

Member Enumeration Documentation

◆ EFreeListOrder

Enumerator
SortBySize 
SortByOffset 

Constructor & Destructor Documentation

◆ FRHIMemoryPool()

FRHIMemoryPool::FRHIMemoryPool ( int16  InPoolIndex,
uint64  InPoolSize,
uint32  InPoolAlignment,
ERHIPoolResourceTypes  InSupportedResourceTypes,
EFreeListOrder  InFreeListOrder 
)

◆ ~FRHIMemoryPool()

FRHIMemoryPool::~FRHIMemoryPool ( )
virtual

Member Function Documentation

◆ AddToFreeBlocks()

FRHIPoolAllocationData * FRHIMemoryPool::AddToFreeBlocks ( FRHIPoolAllocationData InFreeBlock)
protected

◆ Deallocate()

void FRHIMemoryPool::Deallocate ( FRHIPoolAllocationData AllocationData)

◆ Destroy()

void FRHIMemoryPool::Destroy ( )
virtual

Reimplemented in FD3D12MemoryPool.

◆ FindFreeBlock()

int32 FRHIMemoryPool::FindFreeBlock ( uint32  InSizeInBytes,
uint32  InAllocationAlignment 
) const
protected

◆ GetAlignedOffset()

uint32 FRHIMemoryPool::GetAlignedOffset ( uint32  InOffset,
uint32  InPoolAlignment,
uint32  InAllocationAlignment 
)
static

◆ GetAlignedSize()

uint32 FRHIMemoryPool::GetAlignedSize ( uint32  InSizeInBytes,
uint32  InPoolAlignment,
uint32  InAllocationAlignment 
)
static

◆ GetAlignmentWaste()

uint32 FRHIMemoryPool::GetAlignmentWaste ( ) const
inline

◆ GetAllocatedBlocks()

uint32 FRHIMemoryPool::GetAllocatedBlocks ( ) const
inline

◆ GetFreeSize()

uint64 FRHIMemoryPool::GetFreeSize ( ) const
inline

◆ GetNewAllocationData()

FRHIPoolAllocationData * FRHIMemoryPool::GetNewAllocationData ( )
protected

◆ GetPoolIndex()

int16 FRHIMemoryPool::GetPoolIndex ( ) const
inline

◆ GetPoolSize()

uint64 FRHIMemoryPool::GetPoolSize ( ) const
inline

◆ GetSupportedResourceTypes()

ERHIPoolResourceTypes FRHIMemoryPool::GetSupportedResourceTypes ( ) const
inline

◆ GetUsedSize()

uint64 FRHIMemoryPool::GetUsedSize ( ) const
inline

◆ Init()

void FRHIMemoryPool::Init ( )
virtual

Reimplemented in FD3D12MemoryPool.

◆ IsEmpty()

bool FRHIMemoryPool::IsEmpty ( ) const
inline

◆ IsFull()

bool FRHIMemoryPool::IsFull ( ) const
inline

◆ IsResourceTypeSupported()

bool FRHIMemoryPool::IsResourceTypeSupported ( ERHIPoolResourceTypes  InType) const
inline

◆ ReleaseAllocationData()

void FRHIMemoryPool::ReleaseAllocationData ( FRHIPoolAllocationData InData)
protected

◆ RemoveFromFreeBlocks()

void FRHIMemoryPool::RemoveFromFreeBlocks ( FRHIPoolAllocationData InFreeBlock)
protected

◆ TryAllocate()

bool FRHIMemoryPool::TryAllocate ( uint32  InSizeInBytes,
uint32  InAllocationAlignment,
ERHIPoolResourceTypes  InAllocationResourceType,
FRHIPoolAllocationData AllocationData 
)

◆ TryClear()

void FRHIMemoryPool::TryClear ( FRHIContextArray const &  Contexts,
FRHIPoolAllocator InAllocator,
uint32  InMaxCopySize,
uint32 CopySize,
const TArray< FRHIMemoryPool * > &  InTargetPools 
)

◆ Validate()

void FRHIMemoryPool::Validate ( )
protected

Member Data Documentation

◆ AligmnentWaste

uint64 FRHIMemoryPool::AligmnentWaste
protected

◆ AllocatedBlocks

uint32 FRHIMemoryPool::AllocatedBlocks
protected

◆ AllocationDataPool

TArray<FRHIPoolAllocationData*> FRHIMemoryPool::AllocationDataPool
protected

◆ FreeBlocks

TArray<FRHIPoolAllocationData*> FRHIMemoryPool::FreeBlocks
protected

◆ FreeListOrder

const EFreeListOrder FRHIMemoryPool::FreeListOrder
protected

◆ FreeSize

uint64 FRHIMemoryPool::FreeSize
protected

◆ HeadBlock

FRHIPoolAllocationData FRHIMemoryPool::HeadBlock
protected

◆ PoolAlignment

const uint32 FRHIMemoryPool::PoolAlignment
protected

◆ PoolIndex

int16 FRHIMemoryPool::PoolIndex
protected

◆ PoolSize

const uint64 FRHIMemoryPool::PoolSize
protected

◆ SupportedResourceTypes

const ERHIPoolResourceTypes FRHIMemoryPool::SupportedResourceTypes
protected

The documentation for this class was generated from the following files: