Navigation
API > API/Runtime > API/Runtime/Core
FMalloc proxy that poisons new and freed allocations, helping to catch code that relies on uninitialized or freed memory.
| Name | FMallocPoisonProxy |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/HAL/MallocPoisonProxy.h |
| Include Path | #include "HAL/MallocPoisonProxy.h" |
Syntax
class FMallocPoisonProxy : public FMalloc
Inheritance Hierarchy
- FExec → FMalloc → FMallocPoisonProxy
- FUseSystemMallocForNew → FMalloc → FMallocPoisonProxy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMallocPoisonProxy
(
FMalloc* InMalloc |
HAL/MallocPoisonProxy.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| UsedMalloc | FMalloc * | Malloc we're based on, aka using under the hood | HAL/MallocPoisonProxy.h |
Functions
Public
Overridden from FMalloc
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ClearAndDisableTLSCachesOnCurrentThread() |
Clears the TLS caches on the current thread and disables any future caching. | HAL/MallocPoisonProxy.h | |
virtual void DumpAllocatorStats
(
FOutputDevice& Ar |
Dumps current allocator stats to the log. | HAL/MallocPoisonProxy.h | |
virtual void Free
(
void* Original |
Free | HAL/MallocPoisonProxy.h | |
virtual bool GetAllocationSize
(
void* Original, |
If possible determine the size of the memory allocated at the given address | HAL/MallocPoisonProxy.h | |
virtual void GetAllocatorStats
(
FGenericMemoryStats& out_Stats |
Writes allocator stats from the last update into the specified destination. | HAL/MallocPoisonProxy.h | |
virtual const TCHAR * GetDescriptiveName() |
Gets descriptive name for logging purposes. | HAL/MallocPoisonProxy.h | |
virtual void InitializeStatsMetadata () |
Initializes stats metadata. | HAL/MallocPoisonProxy.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/MallocPoisonProxy.h | |
virtual void * Malloc
(
SIZE_T Count, |
Malloc | HAL/MallocPoisonProxy.h | |
virtual void * MallocZeroed
(
SIZE_T Count, |
Malloc zeroed memory | HAL/MallocPoisonProxy.h | |
virtual void MarkTLSCachesAsUnusedOnCurrentThread () |
Mark TLS caches for current thread as unused. | HAL/MallocPoisonProxy.h | |
virtual void MarkTLSCachesAsUsedOnCurrentThread () |
Mark TLS caches for the current thread as used. | HAL/MallocPoisonProxy.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/MallocPoisonProxy.h | |
virtual void OnPostFork() |
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages. | HAL/MallocPoisonProxy.h | |
virtual void OnPreFork () |
Notifies the malloc implementation that the process is about to fork. | HAL/MallocPoisonProxy.h | |
virtual SIZE_T QuantizeSize
(
SIZE_T Count, |
For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. | HAL/MallocPoisonProxy.h | |
virtual void * Realloc
(
void* Original, |
Realloc | HAL/MallocPoisonProxy.h | |
virtual void SetupTLSCachesOnCurrentThread() |
Set up TLS caches on the current thread. These are the threads that we can trim. | HAL/MallocPoisonProxy.h | |
virtual void Trim
(
bool bTrimThreadCaches |
Releases as much memory as possible. Must be called from the main thread. | HAL/MallocPoisonProxy.h | |
virtual void UpdateStats () |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. | HAL/MallocPoisonProxy.h | |
virtual bool ValidateHeap() |
Validates the allocator's heap | HAL/MallocPoisonProxy.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/MallocPoisonProxy.h |