Navigation
API > API/Runtime > API/Runtime/Core
FMalloc proxy that synchronizes access, making the used malloc thread safe.
| Name | FMallocThreadSafeProxy |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/HAL/MallocThreadSafeProxy.h |
| Include Path | #include "HAL/MallocThreadSafeProxy.h" |
Syntax
class FMallocThreadSafeProxy : public FMalloc
Inheritance Hierarchy
- FExec → FMalloc → FMallocThreadSafeProxy
- FUseSystemMallocForNew → FMalloc → FMallocThreadSafeProxy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMallocThreadSafeProxy
(
FMalloc* InMalloc |
Constructor for thread safe proxy malloc that takes a malloc to be used and a synchronization object used via FScopeLock as a parameter. | HAL/MallocThreadSafeProxy.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SynchronizationObject | FCriticalSection | Object used for synchronization via a scoped lock | HAL/MallocThreadSafeProxy.h | |
| UsedMalloc | FMalloc * | Malloc we're based on, aka using under the hood | HAL/MallocThreadSafeProxy.h |
Functions
Public
Overridden from FMalloc
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DumpAllocatorStats
(
FOutputDevice& Ar |
Dumps allocator stats to an output device. | HAL/MallocThreadSafeProxy.h | |
virtual void Free
(
void* Ptr |
Free | HAL/MallocThreadSafeProxy.h | |
virtual bool GetAllocationSize
(
void* Original, |
If possible determine the size of the memory allocated at the given address | HAL/MallocThreadSafeProxy.h | |
virtual void GetAllocatorStats
(
FGenericMemoryStats& out_Stats |
Writes allocator stats from the last update into the specified destination. | HAL/MallocThreadSafeProxy.h | |
virtual const TCHAR * GetDescriptiveName() |
Gets descriptive name for logging purposes. | HAL/MallocThreadSafeProxy.h | |
virtual void InitializeStatsMetadata () |
Initializes stats metadata. | HAL/MallocThreadSafeProxy.h | |
virtual bool IsInternallyThreadSafe() |
Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it. | HAL/MallocThreadSafeProxy.h | |
virtual void * Malloc
(
SIZE_T Size, |
Malloc | HAL/MallocThreadSafeProxy.h | |
virtual void OnMallocInitialized() |
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 | HAL/MallocThreadSafeProxy.h | |
virtual void OnPostFork() |
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages. | HAL/MallocThreadSafeProxy.h | |
virtual void OnPreFork () |
Notifies the malloc implementation that the process is about to fork. | HAL/MallocThreadSafeProxy.h | |
virtual void * Realloc
(
void* Ptr, |
Realloc | HAL/MallocThreadSafeProxy.h | |
virtual void Trim
(
bool bTrimThreadCaches |
Releases as much memory as possible. Must be called from the main thread. | HAL/MallocThreadSafeProxy.h | |
virtual bool ValidateHeap() |
Validates the allocator's heap | HAL/MallocThreadSafeProxy.h |
Overridden from FExec
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool Exec
(
UWorld* InWorld, |
Handles any commands passed in on the command line | HAL/MallocThreadSafeProxy.h |