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

#include <MallocDebug.h>

+ Inheritance diagram for FMallocDebug:
+ Collaboration diagram for FMallocDebug:

Classes

struct  FMemDebug
 

Public Member Functions

 FMallocDebug ()
 
virtual voidMalloc (SIZE_T Size, uint32 Alignment) override
 
virtual voidRealloc (void *InPtr, SIZE_T NewSize, uint32 Alignment) override
 
virtual void Free (void *InPtr) override
 
virtual bool GetAllocationSize (void *Original, SIZE_T &SizeOut) override
 
virtual void DumpAllocatorStats (FOutputDevice &Ar) override
 
virtual bool ValidateHeap () override
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, 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 SIZE_T QuantizeSize (SIZE_T Count, uint32 Alignment)
 
virtual void Trim (bool bTrimThreadCaches)
 
virtual void SetupTLSCachesOnCurrentThread ()
 
virtual void ClearAndDisableTLSCachesOnCurrentThread ()
 
virtual void InitializeStatsMetadata ()
 
virtual void UpdateStats ()
 
virtual void GetAllocatorStats (FGenericMemoryStats &out_Stats)
 
virtual bool IsInternallyThreadSafe () const
 
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 ()
 

Private Types

enum  { MEM_PreTag = 0xf0ed1cee }
 
enum  { MEM_PostTag = 0xdeadf00f }
 
enum  { MEM_Tag = 0xfe }
 
enum  { MEM_WipeTag = 0xcd }
 
enum  { ALLOCATION_ALIGNMENT = 16 }
 
enum  { MEM_SizeMax = 128 }
 
enum  { MEM_Recent = 5000 }
 
enum  { MEM_AgeMax = 80 }
 
enum  { MEM_AgeSlice = 100 }
 

Private Attributes

FMemDebugGFirstDebug
 
SIZE_T TotalAllocationSize
 
SIZE_T TotalWasteSize
 

Static Private Attributes

static constexpr uint32 AllocatorOverhead = sizeof(FMemDebug) + sizeof(FMemDebug*) + sizeof(int32) + ALLOCATION_ALIGNMENT + sizeof(int32)
 

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 12 of file MallocDebug.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_PreTag 

Definition at line 15 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_PostTag 

Definition at line 16 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_Tag 

Definition at line 17 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_WipeTag 

Definition at line 18 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
ALLOCATION_ALIGNMENT 

Definition at line 21 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_SizeMax 

Definition at line 24 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_Recent 

Definition at line 25 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_AgeMax 

Definition at line 26 of file MallocDebug.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MEM_AgeSlice 

Definition at line 27 of file MallocDebug.h.

Constructor & Destructor Documentation

◆ FMallocDebug()

FMallocDebug::FMallocDebug ( )
inline

Definition at line 51 of file MallocDebug.h.

Member Function Documentation

◆ DumpAllocatorStats()

virtual void FMallocDebug::DumpAllocatorStats ( FOutputDevice & Ar)
inlineoverridevirtual

Dumps details about all allocations to an output device

Parameters
Ar[in] Output device

Reimplemented from FMalloc.

Definition at line 174 of file MallocDebug.h.

◆ Exec()

virtual bool FMallocDebug::Exec ( UWorld * InWorld,
const TCHAR * Cmd,
FOutputDevice & Ar )
inlineoverridevirtual

Exec handler

Parameters
InWorldWorld context
CmdCommand to parse
ArOutput device to log to
Returns
true if command was handled, false otherwise

Reimplemented from FExec.

Definition at line 214 of file MallocDebug.h.

◆ Free()

virtual void FMallocDebug::Free ( void * InPtr)
inlineoverridevirtual

Free

Implements FMalloc.

Definition at line 116 of file MallocDebug.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAllocationSize()

virtual bool FMallocDebug::GetAllocationSize ( void * Original,
SIZE_T & SizeOut )
inlineoverridevirtual

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.

Definition at line 154 of file MallocDebug.h.

◆ GetDescriptiveName()

virtual const TCHAR * FMallocDebug::GetDescriptiveName ( )
inlineoverridevirtual

Gets descriptive name for logging purposes.

Returns
pointer to human-readable malloc name

Reimplemented from FMalloc.

Definition at line 219 of file MallocDebug.h.

◆ Malloc()

virtual void * FMallocDebug::Malloc ( SIZE_T Size,
uint32 Alignment )
inlineoverridevirtual

Malloc

Implements FMalloc.

Definition at line 60 of file MallocDebug.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Realloc()

virtual void * FMallocDebug::Realloc ( void * InPtr,
SIZE_T NewSize,
uint32 Alignment )
inlineoverridevirtual

Realloc

Implements FMalloc.

Definition at line 91 of file MallocDebug.h.

+ Here is the call graph for this function:

◆ ValidateHeap()

virtual bool FMallocDebug::ValidateHeap ( )
inlineoverridevirtual

Validates the allocator's heap

Reimplemented from FMalloc.

Definition at line 197 of file MallocDebug.h.

Member Data Documentation

◆ AllocatorOverhead

constexpr uint32 FMallocDebug::AllocatorOverhead = sizeof(FMemDebug) + sizeof(FMemDebug*) + sizeof(int32) + ALLOCATION_ALIGNMENT + sizeof(int32)
staticconstexprprivate

Definition at line 47 of file MallocDebug.h.

◆ GFirstDebug

FMemDebug* FMallocDebug::GFirstDebug
private

Definition at line 40 of file MallocDebug.h.

◆ TotalAllocationSize

SIZE_T FMallocDebug::TotalAllocationSize
private

Total size of allocations

Definition at line 43 of file MallocDebug.h.

◆ TotalWasteSize

SIZE_T FMallocDebug::TotalWasteSize
private

Total size of allocation overhead

Definition at line 45 of file MallocDebug.h.


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