Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FMallocBinned Class Reference

#include <MallocBinned.h>

+ Inheritance diagram for FMallocBinned:
+ Collaboration diagram for FMallocBinned:

Classes

struct  FPoolTable
 

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 TCHAR * GetDescriptiveName () override
 
- Public Member Functions inherited from FMalloc
virtual voidTryMalloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual voidTryRealloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 
virtual void Trim (bool bTrimThreadCaches)
 
virtual void SetupTLSCachesOnCurrentThread ()
 
virtual void ClearAndDisableTLSCachesOnCurrentThread ()
 
virtual void OnMallocInitialized ()
 
virtual void OnPreFork ()
 
virtual void OnPostFork ()
 
- Public Member Functions inherited from FUseSystemMallocForNew
voidoperator new (size_t Size)
 
void operator delete (void *Ptr)
 
voidoperator new[] (size_t Size)
 
void operator delete[] (void *Ptr)
 
- Public Member Functions inherited from FExec
virtual ~FExec ()
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 

Private Types

enum  { POOL_COUNT = 41 }
 
enum  { EXTENDED_PAGE_POOL_ALLOCATION_COUNT = 2 }
 
enum  { MAX_POOLED_ALLOCATION_SIZE = 32768+1 }
 

Private Attributes

uint64 TableAddressLimit
 
FCriticalSection AccessGuard
 
uint64 MaxHashBuckets
 
uint64 MaxHashBucketBits
 
uint64 MaxHashBucketWaste
 
uint64 MaxBookKeepingOverhead
 
uint64 PoolBitShift
 
uint64 IndirectPoolBitShift
 
uint64 IndirectPoolBlockSize
 
uint64 HashKeyShift
 
uint64 PoolMask
 
uint64 BinnedSizeLimit
 
uint64 BinnedOSTableIndex
 
FPoolTable PoolTable [POOL_COUNT]
 
FPoolTable OsTable
 
FPoolTable PagePoolTable [EXTENDED_PAGE_POOL_ALLOCATION_COUNT]
 
FPoolTableMemSizeToPoolTable [MAX_POOLED_ALLOCATION_SIZE+EXTENDED_PAGE_POOL_ALLOCATION_COUNT]
 
PoolHashBucketHashBuckets
 
PoolHashBucketHashBucketFreeList
 
uint32 PageSize
 

Additional Inherited Members

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

Detailed Description

Definition at line 118 of file MallocBinned.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
POOL_COUNT 

Definition at line 125 of file MallocBinned.h.

◆ anonymous enum

anonymous enum
private

Maximum allocation for the pooled allocator

Enumerator
EXTENDED_PAGE_POOL_ALLOCATION_COUNT 

Definition at line 128 of file MallocBinned.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MAX_POOLED_ALLOCATION_SIZE 

Definition at line 129 of file MallocBinned.h.

Constructor & Destructor Documentation

◆ FMallocBinned()

FMallocBinned::FMallocBinned ( uint32 InPageSize,
uint64 AddressLimit )

◆ ~FMallocBinned()

virtual FMallocBinned::~FMallocBinned ( )
virtual

Member Function Documentation

◆ DumpAllocatorStats()

virtual 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()

virtual void FMallocBinned::Free ( void * Ptr)
overridevirtual

Free

Implements FMalloc.

◆ GetAllocationSize()

virtual 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()

virtual void FMallocBinned::GetAllocatorStats ( FGenericMemoryStats & out_Stats)
overridevirtual

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

Reimplemented from FMalloc.

◆ GetDescriptiveName()

virtual const TCHAR * FMallocBinned::GetDescriptiveName ( )
overridevirtual

Gets descriptive name for logging purposes.

Returns
pointer to human-readable malloc name

Reimplemented from FMalloc.

◆ InitializeStatsMetadata()

virtual 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()

virtual 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()

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

Malloc

Implements FMalloc.

◆ QuantizeSize()

virtual 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()

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

Realloc

Implements FMalloc.

◆ UpdateStats()

virtual 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()

virtual bool FMallocBinned::ValidateHeap ( )
overridevirtual

Validates the allocator's heap

Reimplemented from FMalloc.

Member Data Documentation

◆ AccessGuard

FCriticalSection FMallocBinned::AccessGuard
private

Definition at line 219 of file MallocBinned.h.

◆ BinnedOSTableIndex

uint64 FMallocBinned::BinnedOSTableIndex
private

Definition at line 235 of file MallocBinned.h.

◆ BinnedSizeLimit

uint64 FMallocBinned::BinnedSizeLimit
private

Definition at line 234 of file MallocBinned.h.

◆ HashBucketFreeList

PoolHashBucket* FMallocBinned::HashBucketFreeList
private

Definition at line 244 of file MallocBinned.h.

◆ HashBuckets

PoolHashBucket* FMallocBinned::HashBuckets
private

Definition at line 243 of file MallocBinned.h.

◆ HashKeyShift

uint64 FMallocBinned::HashKeyShift
private

Shift required to get required hash table key.

Definition at line 231 of file MallocBinned.h.

◆ IndirectPoolBitShift

uint64 FMallocBinned::IndirectPoolBitShift
private

Definition at line 228 of file MallocBinned.h.

◆ IndirectPoolBlockSize

uint64 FMallocBinned::IndirectPoolBlockSize
private

Definition at line 229 of file MallocBinned.h.

◆ MaxBookKeepingOverhead

uint64 FMallocBinned::MaxBookKeepingOverhead
private

Definition at line 225 of file MallocBinned.h.

◆ MaxHashBucketBits

uint64 FMallocBinned::MaxHashBucketBits
private

Definition at line 223 of file MallocBinned.h.

◆ MaxHashBuckets

uint64 FMallocBinned::MaxHashBuckets
private

Definition at line 222 of file MallocBinned.h.

◆ MaxHashBucketWaste

uint64 FMallocBinned::MaxHashBucketWaste
private

Definition at line 224 of file MallocBinned.h.

◆ MemSizeToPoolTable

FPoolTable* FMallocBinned::MemSizeToPoolTable[MAX_POOLED_ALLOCATION_SIZE+EXTENDED_PAGE_POOL_ALLOCATION_COUNT]
private

Definition at line 241 of file MallocBinned.h.

◆ OsTable

FPoolTable FMallocBinned::OsTable
private

Definition at line 239 of file MallocBinned.h.

◆ PagePoolTable

FPoolTable FMallocBinned::PagePoolTable[EXTENDED_PAGE_POOL_ALLOCATION_COUNT]
private

Definition at line 240 of file MallocBinned.h.

◆ PageSize

uint32 FMallocBinned::PageSize
private

Definition at line 246 of file MallocBinned.h.

◆ PoolBitShift

uint64 FMallocBinned::PoolBitShift
private

Shift to get the reference from the indirect tables

Definition at line 227 of file MallocBinned.h.

◆ PoolMask

uint64 FMallocBinned::PoolMask
private

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

Definition at line 233 of file MallocBinned.h.

◆ PoolTable

FPoolTable FMallocBinned::PoolTable[POOL_COUNT]
private

Definition at line 238 of file MallocBinned.h.

◆ TableAddressLimit

uint64 FMallocBinned::TableAddressLimit
private

Definition at line 205 of file MallocBinned.h.


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