FMallocDoubleFreeFinder

Windows
MacOS
Linux

Inheritance Hierarchy

FUseSystemMallocForNew

FExec

FMalloc

FMallocDoubleFreeFinder

References

Module

Core

Header

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

Include

#include "HAL/MallocDoubleFreeFinder.h"

Syntax

class FMallocDoubleFreeFinder : public FMalloc

Variables

Constructors

Name Description

Public function

FMallocDoubleFreeFinder

(
    FMalloc* InMalloc
)

Functions

Name Description

Protected function

void

 

DecDisabled()

Public function

void

 

DumpStackTraceToLog

(
    int32 StackIndex
)

Protected function

int32

 

GetCallStackIndex()

Protected function

void

 

IncDisabled()

Public function

void

 

Init()

Protected function

bool

 

IsDisabled()

Public function Static

FMalloc *...

 

OverrideIfEnabled

(
    FMalloc* InUsedAlloc
)

Protected function

void

 

TrackFree

(
    void* Ptr,
    uint32 OldSize,
    int32 CallStackIndex
)

Protected function

void

 

TrackMalloc

(
    void* Ptr,
    uint32 Size,
    int32 CallStackIndex
)

Protected function

void

 

TrackRealloc

(
    void* OldPtr,
    void* NewPtr,
    uint32 NewSize,
    uint32 OldSize,
    int32 CallStackIndex
)

Public function

void

 

TrackSpecial

(
    void* Ptr
)

If you get an allocation/memory error outside of the allocator you can call this directly It will dump a callstack of the last allocator free most likely to have caused the problem to the log, if you have symbols loaded Might be useful to pass an access violation ptr to this!

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

Classes

Name

Description

Public struct

FCallStackInfoDoublleFreeFinder

Public struct

FCallStackMapKey

Used as a key in our current allocations/freed allocations maps

Protected struct

TrackedAllocationData

Constants

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