engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 属性 | 所有成员列表
FMalloc类 参考abstract

The global memory allocator's interface. 更多...

#include <MemoryBase.h>

+ 类 FMalloc 继承关系图:

Public 成员函数

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 属性

static TAtomic< uint64 > MaxSingleAlloc
 Limits the maximum single allocation, to this many bytes, for debugging
 

详细描述

The global memory allocator's interface.

成员函数说明

◆ GetAllocationSize()

virtual bool FMalloc::GetAllocationSize ( void *  Original,
SIZE_T &  SizeOut 
)
inlinevirtual

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

被 FGenericPlatformMallocCrash, FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.

◆ GetDescriptiveName()

virtual const TCHAR * FMalloc::GetDescriptiveName ( )
inlinevirtual

Gets descriptive name for logging purposes.

返回
pointer to human-readable malloc name

被 FGenericPlatformMallocCrash, FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.

◆ InitializeStatsMetadata()

virtual void FMalloc::InitializeStatsMetadata ( )
virtual

Initializes stats metadata.

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

被 FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.

◆ QuantizeSize()

virtual SIZE_T FMalloc::QuantizeSize ( SIZE_T  Count,
uint32  Alignment 
)
inlinevirtual

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.

被 FMallocPoisonProxy 重载.

◆ SetupTLSCachesOnCurrentThread()

virtual void FMalloc::SetupTLSCachesOnCurrentThread ( )
inlinevirtual

Set up TLS caches on the current thread.

These are the threads that we can trim.

被 FMallocPoisonProxy 重载.

◆ Trim()

virtual void FMalloc::Trim ( bool  bTrimThreadCaches)
inlinevirtual

Releases as much memory as possible.

Must be called from the main thread.

被 FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.

◆ TryRealloc()

virtual void * FMalloc::TryRealloc ( void *  Original,
SIZE_T  Count,
uint32  Alignment = DEFAULT_ALIGNMENT 
)
virtual

TryRealloc - like Realloc(), but may return a nullptr if the allocation request cannot be satisfied.

Note that in this case the memory pointed to by Original will still be valid

◆ UpdateStats()

virtual void FMalloc::UpdateStats ( )
virtual

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

MUST BE THREAD SAFE.

被 FMallocPoisonProxy 重载.


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