Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TGenericGrowableAllocator< ChunkAllocatorType, GrowableAllocationBaseType > Class Template Reference

#include <GenericGrowableAllocator.h>

+ Inheritance diagram for TGenericGrowableAllocator< ChunkAllocatorType, GrowableAllocationBaseType >:
+ Collaboration diagram for TGenericGrowableAllocator< ChunkAllocatorType, GrowableAllocationBaseType >:

Classes

struct  AllocationInfo
 
struct  AllocFreeCounts
 

Public Member Functions

 TGenericGrowableAllocator (uint64 InitialSize, uint32 InType, uint32 InSubAllocationAlignment, FName InStatRegionName, const FName *InOwnerTypeToStatIdMap, void *InUserData)
 
virtual ~TGenericGrowableAllocator ()
 
GrowableAllocationBaseTypeMalloc (uint32 Size, uint32 Alignment, int32 OwnerType)
 
bool Free (GrowableAllocationBaseType *Memory)
 
void GetAllocationInfo (uint32 &Chunks, uint64 &Used, uint64 &Free)
 
bool DoesAllocatorContainAddress (const void *Address)
 
void ShowAllocationInfo ()
 
void ShowFullAllocationInfo ()
 
void DumpMemoryInfo ()
 
- Public Member Functions inherited from FGrowableMallocBase
 FGrowableMallocBase ()
 
virtual ~FGrowableMallocBase ()
 
virtual uint64 GetWasteApproximation ()
 

Private Member Functions

void UpdateMemoryStatMaxSizes ()
 
ChunkAllocatorTypeCreateAllocChunk (uint64 Size)
 
void RemoveAllocChunk (ChunkAllocatorType *Chunk)
 
void OutOfMemory (uint32 Size)
 

Private Attributes

const uint32 SubAllocationAlignment
 
uint64 CurSizeAllocated
 
uint64 TotalAllocationSize
 
uint64 NumAllocations
 
uint32 MemoryType
 
FName StatRegionName
 
const FNameOwnerTypeToStatIdMap
 
TArray< ChunkAllocatorType * > AllocChunks
 
voidUserData
 
FCriticalSection CriticalSection
 
TMap< int32, AllocationInfoPerTypeAllocationInfo
 
TMap< uint64, uint32TotalAllocationsHistogram
 
TMap< uint64, uint32OutstandingAllocationsHistogram
 
TMap< uint64, uint32PeakAllocationsHistogram
 

Additional Inherited Members

- Protected Attributes inherited from FGrowableMallocBase
uint64 TotalAllocated
 
uint64 TotalWaste
 
uint64 CurrentAllocs
 
uint64 TotalAllocs
 

Detailed Description

template<typename ChunkAllocatorType, typename GrowableAllocationBaseType>
class TGenericGrowableAllocator< ChunkAllocatorType, GrowableAllocationBaseType >

Allocator that will grow as needed with direct mapped memory for a given memory type

Definition at line 512 of file GenericGrowableAllocator.h.

Constructor & Destructor Documentation

◆ TGenericGrowableAllocator()

TGenericGrowableAllocator< ChunkAllocatorType, GrowableAllocationBaseType >::TGenericGrowableAllocator ( uint64 InitialSize,
uint32 InType,
uint32 InSubAllocationAlignment,
FName InStatRegionName,
const FName * InOwnerTypeToStatIdMap,
void * InUserData )
inline

Constructor Internally allocates address space for use only by this allocator

Parameters
Type- The templated memory type to allocate with this allocator
StatRegion- The region of memory this is responsible for, for updating the region max sizes

Definition at line 523 of file GenericGrowableAllocator.h.

◆ ~TGenericGrowableAllocator()

Member Function Documentation

◆ CreateAllocChunk()

Create a new allocation chunk to fit the requested size. All chunks are aligned to MIN_CHUNK_ALIGNMENT

Parameters
Size- size of chunk

Definition at line 804 of file GenericGrowableAllocator.h.

◆ DoesAllocatorContainAddress()

◆ DumpMemoryInfo()

◆ Free()

◆ GetAllocationInfo()

◆ Malloc()

◆ OutOfMemory()

triggered during out of memory failure for this allocator

Definition at line 855 of file GenericGrowableAllocator.h.

◆ RemoveAllocChunk()

Removes an existing allocated chunk. Unmaps its memory, decommits physical memory back to OS, flushes address entries associated with it, and deletes it

Parameters
Chunk- existing chunk to remove

Definition at line 835 of file GenericGrowableAllocator.h.

◆ ShowAllocationInfo()

◆ ShowFullAllocationInfo()

◆ UpdateMemoryStatMaxSizes()

Updates the memory stat max sizes when chunks are added/removed

Definition at line 795 of file GenericGrowableAllocator.h.

Member Data Documentation

◆ AllocChunks

◆ CriticalSection

◆ CurSizeAllocated

total currently allocated from OS

Definition at line 867 of file GenericGrowableAllocator.h.

◆ MemoryType

The type of memory this allocator allocates from the kernel

Definition at line 874 of file GenericGrowableAllocator.h.

◆ NumAllocations

◆ OutstandingAllocationsHistogram

◆ OwnerTypeToStatIdMap

For stats/dumping, we use this to convert OwnerType of an allocation to a printable name

Definition at line 880 of file GenericGrowableAllocator.h.

◆ PeakAllocationsHistogram

◆ PerTypeAllocationInfo

◆ StatRegionName

The stat memory region to update max size

Definition at line 877 of file GenericGrowableAllocator.h.

◆ SubAllocationAlignment

◆ TotalAllocationsHistogram

◆ TotalAllocationSize

◆ UserData


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