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.
|
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 |
被 FGenericPlatformMallocCrash, FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.
|
inlinevirtual |
Gets descriptive name for logging purposes.
被 FGenericPlatformMallocCrash, FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.
|
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 重载.
|
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 重载.
|
inlinevirtual |
Set up TLS caches on the current thread.
These are the threads that we can trim.
被 FMallocPoisonProxy 重载.
|
inlinevirtual |
Releases as much memory as possible.
Must be called from the main thread.
被 FMallocPoisonProxy , 以及 FMallocThreadSafeProxy 重载.
|
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
|
virtual |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats.
MUST BE THREAD SAFE.
被 FMallocPoisonProxy 重载.