UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRHIPoolAllocator Class Referenceabstract

Manages an array of FRHIMemoryPool and supports defragmentation between multiple pools. More...

#include <RHIPoolAllocator.h>

+ Inheritance diagram for FRHIPoolAllocator:

Public Member Functions

RHICORE_API FRHIPoolAllocator (uint64 InDefaultPoolSize, uint32 InPoolAlignment, uint32 InMaxAllocationSize, FRHIMemoryPool::EFreeListOrder InFreeListOrder, bool InDefragEnabled)
 
virtual RHICORE_API ~FRHIPoolAllocator ()
 
RHICORE_API void Initialize ()
 
RHICORE_API void Destroy ()
 
RHICORE_API void Defrag (FRHIContextArray const &Contexts, uint32 InMaxCopySize, uint32 &CurrentCopySize)
 
RHICORE_API void UpdateMemoryStats (uint32 &IOMemoryAllocated, uint32 &IOMemoryUsed, uint32 &IOMemoryFree, uint32 &IOMemoryEndFree, uint32 &IOAlignmentWaste, uint32 &IOAllocatedPageCount, uint32 &IOFullPageCount)
 

Protected Member Functions

RHICORE_API bool TryAllocateInternal (uint32 InSizeInBytes, uint32 InAllocationAlignment, ERHIPoolResourceTypes InAllocationResourceType, FRHIPoolAllocationData &AllocationData)
 
RHICORE_API void DeallocateInternal (FRHIPoolAllocationData &AllocationData)
 
RHICORE_API void SortPools ()
 
virtual FRHIMemoryPoolCreateNewPool (int16 InPoolIndex, uint32 InMinimumAllocationSize, ERHIPoolResourceTypes InAllocationResourceType)=0
 
virtual bool HandleDefragRequest (FRHIContextArray const &Contexts, FRHIPoolAllocationData *InSourceBlock, FRHIPoolAllocationData &InTmpTargetBlock)=0
 

Protected Attributes

const uint64 DefaultPoolSize
 
const uint32 PoolAlignment
 
const uint64 MaxAllocationSize
 
const FRHIMemoryPool::EFreeListOrder FreeListOrder
 
const bool bDefragEnabled
 
FCriticalSection CS
 
TArray< FRHIMemoryPool * > Pools
 
int32 LastDefragPoolIndex
 
TArray< uint32PoolAllocationOrder
 
uint32 TotalAllocatedBlocks
 

Friends

class FRHIMemoryPool
 

Detailed Description

Manages an array of FRHIMemoryPool and supports defragmentation between multiple pools.

Constructor & Destructor Documentation

◆ FRHIPoolAllocator()

FRHIPoolAllocator::FRHIPoolAllocator ( uint64  InDefaultPoolSize,
uint32  InPoolAlignment,
uint32  InMaxAllocationSize,
FRHIMemoryPool::EFreeListOrder  InFreeListOrder,
bool  InDefragEnabled 
)

◆ ~FRHIPoolAllocator()

FRHIPoolAllocator::~FRHIPoolAllocator ( )
virtual

Member Function Documentation

◆ CreateNewPool()

virtual FRHIMemoryPool * FRHIPoolAllocator::CreateNewPool ( int16  InPoolIndex,
uint32  InMinimumAllocationSize,
ERHIPoolResourceTypes  InAllocationResourceType 
)
protectedpure virtual

Implemented in FD3D12PoolAllocator.

◆ DeallocateInternal()

void FRHIPoolAllocator::DeallocateInternal ( FRHIPoolAllocationData AllocationData)
protected

◆ Defrag()

void FRHIPoolAllocator::Defrag ( FRHIContextArray const &  Contexts,
uint32  InMaxCopySize,
uint32 CurrentCopySize 
)

◆ Destroy()

void FRHIPoolAllocator::Destroy ( )

◆ HandleDefragRequest()

virtual bool FRHIPoolAllocator::HandleDefragRequest ( FRHIContextArray const &  Contexts,
FRHIPoolAllocationData InSourceBlock,
FRHIPoolAllocationData InTmpTargetBlock 
)
protectedpure virtual

Implemented in FD3D12PoolAllocator.

◆ Initialize()

void FRHIPoolAllocator::Initialize ( )

◆ SortPools()

void FRHIPoolAllocator::SortPools ( )
protected

◆ TryAllocateInternal()

bool FRHIPoolAllocator::TryAllocateInternal ( uint32  InSizeInBytes,
uint32  InAllocationAlignment,
ERHIPoolResourceTypes  InAllocationResourceType,
FRHIPoolAllocationData AllocationData 
)
protected

◆ UpdateMemoryStats()

void FRHIPoolAllocator::UpdateMemoryStats ( uint32 IOMemoryAllocated,
uint32 IOMemoryUsed,
uint32 IOMemoryFree,
uint32 IOMemoryEndFree,
uint32 IOAlignmentWaste,
uint32 IOAllocatedPageCount,
uint32 IOFullPageCount 
)

Friends And Related Symbol Documentation

◆ FRHIMemoryPool

friend class FRHIMemoryPool
friend

Member Data Documentation

◆ bDefragEnabled

const bool FRHIPoolAllocator::bDefragEnabled
protected

◆ CS

FCriticalSection FRHIPoolAllocator::CS
protected

◆ DefaultPoolSize

const uint64 FRHIPoolAllocator::DefaultPoolSize
protected

◆ FreeListOrder

const FRHIMemoryPool::EFreeListOrder FRHIPoolAllocator::FreeListOrder
protected

◆ LastDefragPoolIndex

int32 FRHIPoolAllocator::LastDefragPoolIndex
protected

◆ MaxAllocationSize

const uint64 FRHIPoolAllocator::MaxAllocationSize
protected

◆ PoolAlignment

const uint32 FRHIPoolAllocator::PoolAlignment
protected

◆ PoolAllocationOrder

TArray<uint32> FRHIPoolAllocator::PoolAllocationOrder
protected

◆ Pools

TArray<FRHIMemoryPool*> FRHIPoolAllocator::Pools
protected

◆ TotalAllocatedBlocks

uint32 FRHIPoolAllocator::TotalAllocatedBlocks
protected

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