Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/HAL
Inheritance Hierarchy
- FUseSystemMallocForNew
- FExec
- FMalloc
- FGenericPlatformMallocCrash
- FGenericStackBasedMallocCrash
- FMallocAnsi
- FMallocBinned
- FMallocBinned2
- FMallocCallstackHandler
- FMallocDoubleFreeFinder
- FMallocFrameProfiler
- FMallocDebug
- FMallocPoisonProxy
- FMallocThreadSafeProxy
- FTraceMalloc
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/HAL/MemoryBase.h |
| Include | #include "HAL/MemoryBase.h" |
Syntax
class FMalloc :
public FUseSystemMallocForNew,
public FExec
Remarks
The global memory allocator's interface.
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Clears the TLS caches on the current thread and disables any future caching. | ||
| void | DumpAllocatorStats
(
FOutputDevice& Ar |
Dumps current allocator stats to the log. | |
| void | Free
(
void* Original |
Free | |
| bool | GetAllocationSize
(
void* Original, |
If possible determine the size of the memory allocated at the given address | |
| void | GetAllocatorStats
(
FGenericMemoryStats& out_Stats |
Writes allocator stats from the last update into the specified destination. | |
| const TCHAR * | Gets descriptive name for logging purposes. | ||
| void | Initializes stats metadata. | ||
| bool | Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it. | ||
| void * | Malloc
(
SIZE_T Count, |
Malloc | |
| void | Notifies the malloc implementation that initialization of all allocators in GMalloc is complete, so it's safe to initialize any extra features that require "regular" allocations | ||
| void | OnPostFork () |
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages. | |
| void | OnPreFork () |
Notifies the malloc implementation that the process is about to fork. | |
| SIZE_T | QuantizeSize
(
SIZE_T Count, |
For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. | |
| void * | Realloc
(
void* Original, |
Realloc | |
| void | Set up TLS caches on the current thread. These are the threads that we can trim. | ||
| void | Trim
(
bool bTrimThreadCaches |
Releases as much memory as possible. Must be called from the main thread. | |
| void * | TryMalloc
(
SIZE_T Count, |
TryMalloc - like Malloc(), but may return a nullptr result if the allocation request cannot be satisfied. | |
| void * | TryRealloc
(
void* Original, |
TryRealloc - like Realloc(), but may return a nullptr if the allocation request cannot be satisfied. | |
| void | UpdateStats () |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. | |
| bool | ValidateHeap () |
Validates the allocator's heap |
Constants
| Name | Description |
|---|---|
| MaxSingleAlloc | Limits the maximum single allocation, to this many bytes, for debugging |