FMallocPoisonProxy

[FMalloc](API\Runtime\Core\HAL\FMalloc) proxy that poisons new and freed allocations, helping to catch code that relies on uninitialized or freed memory.

Windows
MacOS
Linux

Inheritance Hierarchy

FUseSystemMallocForNew

FExec

FMalloc

FMallocPoisonProxy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/HAL/MallocPoisonProxy.h

Include

#include "HAL/MallocPoisonProxy.h"

Syntax

class FMallocPoisonProxy : public FMalloc

Remarks

FMalloc proxy that poisons new and freed allocations, helping to catch code that relies on uninitialized or freed memory.

Constructors

Name Description

Public function

FMallocPoisonProxy

(
    FMalloc* InMalloc
)

Overridden from FMalloc

Name Description

Public function Virtual

void

 

ClearAndDisableTLSCachesOnCurrentThread()

Clears the TLS caches on the current thread and disables any future caching.

Public function Virtual

void

 

DumpAllocatorStats

(
    FOutputDevice& Ar
)

Dumps current allocator stats to the log.

Public function Virtual

void

 

Free

(
    void* Original
)

Free

Public function Virtual

bool

 

GetAllocationSize

(
    void* Original,
    SIZE_T& SizeOut
)

If possible determine the size of the memory allocated at the given address

Public function Virtual

void

 

GetAllocatorStats

(
    FGenericMemoryStats& out_Stats
)

Writes allocator stats from the last update into the specified destination.

Public function Virtual

const TCHAR ...

 

GetDescriptiveName()

Gets descriptive name for logging purposes.

Public function Virtual

void

 

InitializeStatsMetadata()

Initializes stats metadata.

Public function Virtual Const

bool

 

IsInternallyThreadSafe()

Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.

Public function Virtual

void *

 

Malloc

(
    SIZE_T Count,
    uint32 Alignment
)

Malloc

Public function 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.

Public function Virtual

void *

 

Realloc

(
    void* Original,
    SIZE_T Count,
    uint32 Alignment
)

Realloc

Public function Virtual

void

 

SetupTLSCachesOnCurrentThread()

Set up TLS caches on the current thread. These are the threads that we can trim.

Public function Virtual

void

 

Trim

(
    bool bTrimThreadCaches
)

Releases as much memory as possible. Must be called from the main thread.

Public function Virtual

void

 

UpdateStats()

Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats.

Public function Virtual

bool

 

ValidateHeap()

Validates the allocator's heap

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld* InWorld,
    const TCHAR* Cmd,
    FOutputDevice& Ar
)

Handles any commands passed in on the command line

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss