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

#include <MallocBinned.h>

+ Inheritance diagram for FMallocBinned:

Classes

struct  FFreeMem
 
struct  FPoolInfo
 
struct  PoolHashBucket
 
struct  Private
 

Public Member Functions

 FMallocBinned (uint32 InPageSize, uint64 AddressLimit)
 
virtual void InitializeStatsMetadata () override
 
virtual ~FMallocBinned ()
 
virtual bool IsInternallyThreadSafe () const override
 
virtual voidMalloc (SIZE_T Size, uint32 Alignment) override
 
virtual voidRealloc (void *Ptr, SIZE_T NewSize, uint32 Alignment) override
 
virtual void Free (void *Ptr) override
 
virtual bool GetAllocationSize (void *Original, SIZE_T &SizeOut) override
 
virtual SIZE_T QuantizeSize (SIZE_T Count, uint32 Alignment) override
 
virtual bool ValidateHeap () override
 
virtual void UpdateStats () override
 
virtual void GetAllocatorStats (FGenericMemoryStats &out_Stats) override
 
virtual void DumpAllocatorStats (class FOutputDevice &Ar) override
 
virtual const TCHARGetDescriptiveName () override
 
- Public Member Functions inherited from FMalloc
virtual CORE_API voidTryMalloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual CORE_API voidTryRealloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual CORE_API voidMallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual CORE_API voidTryMallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual void Trim (bool bTrimThreadCaches)
 
virtual void SetupTLSCachesOnCurrentThread ()
 
virtual void MarkTLSCachesAsUsedOnCurrentThread ()
 
virtual void MarkTLSCachesAsUnusedOnCurrentThread ()
 
virtual void ClearAndDisableTLSCachesOnCurrentThread ()
 
virtual void OnMallocInitialized ()
 
virtual void OnPreFork ()
 
virtual void OnPostFork ()
 
virtual uint64 GetImmediatelyFreeableCachedMemorySize () const
 
virtual uint64 GetTotalFreeCachedMemorySize () const
 
- Public Member Functions inherited from FUseSystemMallocForNew
CORE_API voidoperator new (size_t Size)
 
CORE_API void operator delete (void *Ptr)
 
voidoperator new[] (size_t Size)
 
void operator delete[] (void *Ptr)
 
- Public Member Functions inherited from FExec
virtual CORE_API ~FExec ()
 
virtual CORE_API bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 

Additional Inherited Members

- Static Public Attributes inherited from FMalloc
static CORE_API TAtomic< uint64MaxSingleAlloc
 
- Protected Member Functions inherited from FExec
virtual bool Exec_Runtime (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual bool Exec_Dev (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual bool Exec_Editor (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 

Constructor & Destructor Documentation

◆ FMallocBinned()

FMallocBinned::FMallocBinned ( uint32  InPageSize,
uint64  AddressLimit 
)

Shift to get the reference from the indirect tables

Shift required to get required hash table key.

Used to mask off the bits that have been used to lookup the indirect table

The following options are not valid for page sizes less than 64k. They are here to reduce waste

◆ ~FMallocBinned()

FMallocBinned::~FMallocBinned ( )
virtual

Member Function Documentation

◆ DumpAllocatorStats()

void FMallocBinned::DumpAllocatorStats ( class FOutputDevice Ar)
overridevirtual

Dumps allocator stats to an output device. Subclasses should override to add additional info

Parameters
Ar[in] Output device

Reimplemented from FMalloc.

◆ Free()

void FMallocBinned::Free ( void Ptr)
overridevirtual

Free

Implements FMalloc.

◆ GetAllocationSize()

bool FMallocBinned::GetAllocationSize ( void Original,
SIZE_T SizeOut 
)
overridevirtual

If possible determine the size of the memory allocated at the given address

Parameters
Original- Pointer to memory we are checking the size of
SizeOut- If possible, this value is set to the size of the passed in pointer
Returns
true if succeeded

Reimplemented from FMalloc.

◆ GetAllocatorStats()

void FMallocBinned::GetAllocatorStats ( FGenericMemoryStats out_Stats)
overridevirtual

Writes allocator stats from the last update into the specified destination.

Reimplemented from FMalloc.

◆ GetDescriptiveName()

const TCHAR * FMallocBinned::GetDescriptiveName ( )
overridevirtual

Gets descriptive name for logging purposes.

Returns
pointer to human-readable malloc name

Reimplemented from FMalloc.

◆ InitializeStatsMetadata()

void FMallocBinned::InitializeStatsMetadata ( )
overridevirtual

Initializes stats metadata. We need to do this as soon as possible, but cannot be done in the constructor due to the FName::StaticInit

Reimplemented from FMalloc.

◆ IsInternallyThreadSafe()

bool FMallocBinned::IsInternallyThreadSafe ( ) const
overridevirtual

Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.

Reimplemented from FMalloc.

◆ Malloc()

void * FMallocBinned::Malloc ( SIZE_T  Size,
uint32  Alignment 
)
overridevirtual

Malloc

Implements FMalloc.

◆ QuantizeSize()

SIZE_T FMallocBinned::QuantizeSize ( SIZE_T  Count,
uint32  Alignment 
)
overridevirtual

For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. The return value will always be >= Count. This can be used to grow and shrink containers to optimal sizes. This call is always fast and threadsafe with no locking.

Reimplemented from FMalloc.

◆ Realloc()

void * FMallocBinned::Realloc ( void Ptr,
SIZE_T  NewSize,
uint32  Alignment 
)
overridevirtual

Realloc

Implements FMalloc.

◆ UpdateStats()

void FMallocBinned::UpdateStats ( )
overridevirtual

Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. MUST BE THREAD SAFE.

Reimplemented from FMalloc.

◆ ValidateHeap()

bool FMallocBinned::ValidateHeap ( )
overridevirtual

Validates the allocator's heap

Reimplemented from FMalloc.


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