engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FMallocPoisonProxy类 参考

FMalloc proxy that poisons new and freed allocations, helping to catch code that relies on uninitialized or freed memory. 更多...

#include <MallocPoisonProxy.h>

+ 类 FMallocPoisonProxy 继承关系图:

Public 成员函数

virtual void ClearAndDisableTLSCachesOnCurrentThread () override
 Clears the TLS caches on the current thread and disables any future caching.
 
virtual void DumpAllocatorStats (class FOutputDevice &Ar) override
 Dumps current allocator stats to the log.
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) override
 Handles any commands passed in on the command line
 
virtual void Free (void *Ptr) override
 Free
 
virtual bool GetAllocationSize (void *Original, SIZE_T &SizeOut) override
 If possible determine the size of the memory allocated at the given address 更多...
 
virtual void GetAllocatorStats (FGenericMemoryStats &out_Stats) override
 Writes allocator stats from the last update into the specified destination.
 
virtual const TCHAR * GetDescriptiveName () override
 Gets descriptive name for logging purposes. 更多...
 
virtual void InitializeStatsMetadata () override
 Initializes stats metadata. 更多...
 
virtual bool IsInternallyThreadSafe () const override
 Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.
 
virtual void * Malloc (SIZE_T Size, uint32 Alignment) override
 Malloc
 
virtual SIZE_T QuantizeSize (SIZE_T Count, uint32 Alignment) override
 For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. 更多...
 
virtual void * Realloc (void *Ptr, SIZE_T NewSize, uint32 Alignment) override
 Realloc
 
virtual void SetupTLSCachesOnCurrentThread () override
 Set up TLS caches on the current thread. 更多...
 
virtual void Trim (bool bTrimThreadCaches) override
 Releases as much memory as possible. 更多...
 
virtual void UpdateStats () override
 Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. 更多...
 
virtual bool ValidateHeap () override
 Validates the allocator's heap
 
- Public 成员函数 继承自 FMalloc
virtual void ClearAndDisableTLSCachesOnCurrentThread ()
 Clears the TLS caches on the current thread and disables any future caching.
 
virtual void DumpAllocatorStats (class FOutputDevice &Ar)
 Dumps current allocator stats to the log.
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) override
 Handles any commands passed in on the command line
 
virtual void Free (void *Original)=0
 Free
 
virtual bool GetAllocationSize (void *Original, SIZE_T &SizeOut)
 If possible determine the size of the memory allocated at the given address 更多...
 
virtual void GetAllocatorStats (FGenericMemoryStats &out_Stats)
 Writes allocator stats from the last update into the specified destination.
 
virtual const TCHAR * GetDescriptiveName ()
 Gets descriptive name for logging purposes. 更多...
 
virtual void InitializeStatsMetadata ()
 Initializes stats metadata. 更多...
 
virtual bool IsInternallyThreadSafe () const
 Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.
 
virtual void * Malloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)=0
 Malloc
 
virtual SIZE_T QuantizeSize (SIZE_T Count, uint32 Alignment)
 For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. 更多...
 
virtual void * Realloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)=0
 Realloc
 
virtual void SetupTLSCachesOnCurrentThread ()
 Set up TLS caches on the current thread. 更多...
 
virtual void Trim (bool bTrimThreadCaches)
 Releases as much memory as possible. 更多...
 
virtual void * TryMalloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 TryMalloc - like Malloc(), but may return a nullptr result if the allocation request cannot be satisfied.
 
virtual void * TryRealloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
 TryRealloc - like Realloc(), but may return a nullptr if the allocation request cannot be satisfied. 更多...
 
virtual void UpdateStats ()
 Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. 更多...
 
virtual bool ValidateHeap ()
 Validates the allocator's heap
 
- Public 成员函数 继承自 FUseSystemMallocForNew
void operator delete (void *Ptr)
 Overloaded delete operator using the system allocator 更多...
 
void operator delete[] (void *Ptr)
 Overloaded array delete operator using the system allocator 更多...
 
void * operator new (size_t Size)
 Overloaded new operator using the system allocator. 更多...
 
void * operator new[] (size_t Size)
 Overloaded array new operator using the system allocator. 更多...
 

额外继承的成员函数

- 静态 Public 属性 继承自 FMalloc
static TAtomic< uint64 > MaxSingleAlloc
 Limits the maximum single allocation, to this many bytes, for debugging
 

详细描述

FMalloc proxy that poisons new and freed allocations, helping to catch code that relies on uninitialized or freed memory.

成员函数说明

◆ GetAllocationSize()

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

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

参数
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
返回
true if succeeded

重载 FMalloc .

◆ GetDescriptiveName()

virtual const TCHAR * FMallocPoisonProxy::GetDescriptiveName ( )
inlineoverridevirtual

Gets descriptive name for logging purposes.

返回
pointer to human-readable malloc name

重载 FMalloc .

◆ InitializeStatsMetadata()

virtual void FMallocPoisonProxy::InitializeStatsMetadata ( )
inlineoverridevirtual

Initializes stats metadata.

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

重载 FMalloc .

◆ QuantizeSize()

virtual SIZE_T FMallocPoisonProxy::QuantizeSize ( SIZE_T  Count,
uint32  Alignment 
)
inlineoverridevirtual

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.

重载 FMalloc .

◆ SetupTLSCachesOnCurrentThread()

virtual void FMallocPoisonProxy::SetupTLSCachesOnCurrentThread ( )
inlineoverridevirtual

Set up TLS caches on the current thread.

These are the threads that we can trim.

重载 FMalloc .

◆ Trim()

virtual void FMallocPoisonProxy::Trim ( bool  bTrimThreadCaches)
inlineoverridevirtual

Releases as much memory as possible.

Must be called from the main thread.

重载 FMalloc .

◆ UpdateStats()

virtual void FMallocPoisonProxy::UpdateStats ( )
inlineoverridevirtual

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

MUST BE THREAD SAFE.

重载 FMalloc .


该类的文档由以下文件生成: