Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/HAL
Inheritance Hierarchy
- FUseSystemMallocForNew
- FExec
- FMalloc
- FMallocCallstackHandler
- FMallocDoubleFreeFinder
- FMallocFrameProfiler
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/HAL/MallocCallstackHandler.h |
| Include | #include "HAL/MallocCallstackHandler.h" |
Syntax
class FMallocCallstackHandler : public FMalloc
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< FCallStackInfo > | CallStackInfoArray | ||
| TMap< FCallStackMapKey, int32 > | CallStackMapKeyToCallStackIndexMap | ||
| FCriticalSection | CriticalSection | ||
| uint32 | DisabledTLS | ||
| bool | Initialized | ||
| FRWLock | RWLock | ||
| FMalloc * | UsedMalloc | Malloc we're based on, aka using under the hood |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FMallocCallstackHandler
(
FMalloc* InMalloc |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | DecDisabled () |
||
| void | DumpStackTraceToLog
(
int32 StackIndex |
||
| int32 | |||
| void | IncDisabled () |
||
| void | Init () |
||
| bool | IsDisabled () |
||
| void | TrackFree
(
void* Ptr, |
||
| void | TrackMalloc
(
void* Ptr, |
||
| void | TrackRealloc
(
void* OldPtr, |
Overridden from FMalloc
| 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 | UpdateStats () |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. | |
| bool | ValidateHeap () |
Validates the allocator's heap |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCallStackInfo | |||
| FCallStackMapKey | Used as a key in our current allocations/freed allocations maps |
Constants
| Name | Description |
|---|---|
| CallStackEntriesToSkipCount | |
| MaxCallStackDepth |