#include <MallocCallstackHandler.h>
|
| CORE_API | FMallocCallstackHandler (FMalloc *InMalloc) |
| |
| virtual CORE_API void * | Malloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) override |
| |
| virtual CORE_API void * | Realloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) override |
| |
| virtual CORE_API void | Free (void *Original) override |
| |
| virtual SIZE_T | QuantizeSize (SIZE_T Count, uint32 Alignment) override |
| |
| virtual bool | GetAllocationSize (void *Original, SIZE_T &SizeOut) override |
| |
| virtual void | Trim (bool bTrimThreadCaches) override |
| |
| virtual void | SetupTLSCachesOnCurrentThread () override |
| |
| virtual void | MarkTLSCachesAsUsedOnCurrentThread () override |
| |
| virtual void | MarkTLSCachesAsUnusedOnCurrentThread () |
| |
| virtual void | ClearAndDisableTLSCachesOnCurrentThread () override |
| |
| virtual void | InitializeStatsMetadata () override |
| |
| virtual void | UpdateStats () override |
| |
| virtual void | GetAllocatorStats (FGenericMemoryStats &out_Stats) override |
| |
| virtual void | DumpAllocatorStats (class FOutputDevice &Ar) override |
| |
| virtual bool | IsInternallyThreadSafe () const override |
| |
| virtual bool | ValidateHeap () override |
| |
| virtual const TCHAR * | GetDescriptiveName () override |
| |
| virtual void | OnMallocInitialized () override |
| |
| virtual void | OnPreFork () override |
| |
| virtual void | OnPostFork () override |
| |
| virtual void | Init () |
| |
| void | DumpStackTraceToLog (int32 StackIndex) |
| |
| virtual CORE_API void * | TryMalloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | TryRealloc (void *Original, SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | MallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual CORE_API void * | TryMallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
| |
| virtual uint64 | GetImmediatelyFreeableCachedMemorySize () const |
| |
| virtual uint64 | GetTotalFreeCachedMemorySize () const |
| |
| CORE_API void * | operator new (size_t Size) |
| |
| CORE_API void | operator delete (void *Ptr) |
| |
| void * | operator new[] (size_t Size) |
| |
| void | operator delete[] (void *Ptr) |
| |
| virtual CORE_API | ~FExec () |
| |
| virtual CORE_API bool | Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
|
| void | IncDisabled () |
| |
| void | DecDisabled () |
| |
| virtual bool | IsDisabled () |
| |
| virtual CORE_API void | TrackRealloc (void *OldPtr, void *NewPtr, uint32 NewSize, uint32 OldSize, int32 CallStackIndex) |
| |
| virtual void | TrackMalloc (void *Ptr, uint32 Size, int32 CallStackIndex)=0 |
| |
| virtual void | TrackFree (void *Ptr, uint32 OldSize, int32 CallStackIndex)=0 |
| |
| virtual int32 | GetCallStackIndex () |
| |
| virtual bool | Exec_Runtime (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
| virtual bool | Exec_Dev (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
| virtual bool | Exec_Editor (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar) |
| |
◆ FMallocCallstackHandler()
| FMallocCallstackHandler::FMallocCallstackHandler |
( |
FMalloc * |
InMalloc | ) |
|
◆ ClearAndDisableTLSCachesOnCurrentThread()
| virtual void FMallocCallstackHandler::ClearAndDisableTLSCachesOnCurrentThread |
( |
| ) |
|
|
inlineoverridevirtual |
Clears the TLS caches on the current thread and disables any future caching.
Reimplemented from FMalloc.
◆ DecDisabled()
| void FMallocCallstackHandler::DecDisabled |
( |
| ) |
|
|
inlineprotected |
◆ DumpAllocatorStats()
Dumps current allocator stats to the log.
Reimplemented from FMalloc.
◆ DumpStackTraceToLog()
◆ Free()
| void FMallocCallstackHandler::Free |
( |
void * |
Original | ) |
|
|
overridevirtual |
◆ GetAllocationSize()
If possible determine the size of the memory allocated at the given address
- Parameters
-
| Original | - Pointer to memory we are checking the size of |
| SizeOut | - If possible, this value is set to the size of the passed in pointer |
- Returns
- true if succeeded
Reimplemented from FMalloc.
◆ GetAllocatorStats()
Writes allocator stats from the last update into the specified destination.
Reimplemented from FMalloc.
◆ GetCallStackIndex()
| int32 FMallocCallstackHandler::GetCallStackIndex |
( |
| ) |
|
|
protectedvirtual |
◆ GetDescriptiveName()
| virtual const TCHAR * FMallocCallstackHandler::GetDescriptiveName |
( |
| ) |
|
|
inlineoverridevirtual |
Gets descriptive name for logging purposes.
- Returns
- pointer to human-readable malloc name
Reimplemented from FMalloc.
◆ IncDisabled()
| void FMallocCallstackHandler::IncDisabled |
( |
| ) |
|
|
inlineprotected |
◆ Init()
| void FMallocCallstackHandler::Init |
( |
| ) |
|
|
virtual |
◆ InitializeStatsMetadata()
| virtual void FMallocCallstackHandler::InitializeStatsMetadata |
( |
| ) |
|
|
inlineoverridevirtual |
Initializes stats metadata. We need to do this as soon as possible, but cannot be done in the constructor due to the FName::StaticInit
Reimplemented from FMalloc.
◆ IsDisabled()
◆ IsInternallyThreadSafe()
| virtual bool FMallocCallstackHandler::IsInternallyThreadSafe |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns if the allocator is guaranteed to be thread-safe and therefore doesn't need a unnecessary thread-safety wrapper around it.
Reimplemented from FMalloc.
◆ Malloc()
◆ MarkTLSCachesAsUnusedOnCurrentThread()
| virtual void FMallocCallstackHandler::MarkTLSCachesAsUnusedOnCurrentThread |
( |
| ) |
|
|
inlinevirtual |
Mark TLS caches for current thread as unused. Typically before going to sleep. These are the threads that we can trim without waking them up.
Reimplemented from FMalloc.
◆ MarkTLSCachesAsUsedOnCurrentThread()
| virtual void FMallocCallstackHandler::MarkTLSCachesAsUsedOnCurrentThread |
( |
| ) |
|
|
inlineoverridevirtual |
Mark TLS caches for the current thread as used. Thread has woken up to do some processing and needs its TLS caches back.
Reimplemented from FMalloc.
◆ OnMallocInitialized()
| virtual void FMallocCallstackHandler::OnMallocInitialized |
( |
| ) |
|
|
inlineoverridevirtual |
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
Reimplemented from FMalloc.
◆ OnPostFork()
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages.
Reimplemented from FMalloc.
◆ OnPreFork()
Notifies the malloc implementation that the process is about to fork. May be used to trim caches etc.
Reimplemented from FMalloc.
◆ QuantizeSize()
For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. The return value will always be >= Count. This can be used to grow and shrink containers to optimal sizes. This call is always fast and thread safe with no locking.
Reimplemented from FMalloc.
◆ Realloc()
◆ SetupTLSCachesOnCurrentThread()
| virtual void FMallocCallstackHandler::SetupTLSCachesOnCurrentThread |
( |
| ) |
|
|
inlineoverridevirtual |
Set up TLS caches on the current thread. These are the threads that we can trim.
Reimplemented from FMalloc.
◆ TrackFree()
◆ TrackMalloc()
◆ TrackRealloc()
◆ Trim()
Releases as much memory as possible. Must be called from the main thread.
Reimplemented from FMalloc.
◆ UpdateStats()
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. MUST BE THREAD SAFE.
Reimplemented from FMalloc.
Reimplemented in FMallocFrameProfiler.
◆ ValidateHeap()
Validates the allocator's heap
Reimplemented from FMalloc.
◆ FScopeDisableMallocCallstackHandler
◆ CallStackEntriesToSkipCount
◆ CallStackInfoArray
◆ CallStackMapKeyToCallStackIndexMap
◆ CriticalSection
◆ DisabledTLS
| uint32 FMallocCallstackHandler::DisabledTLS |
|
protected |
◆ Initialized
| bool FMallocCallstackHandler::Initialized |
|
protected |
◆ MaxCallStackDepth
◆ RWLock
| FRWLock FMallocCallstackHandler::RWLock |
|
protected |
◆ UsedMalloc
| FMalloc* FMallocCallstackHandler::UsedMalloc |
|
protected |
Malloc we're based on, aka using under the hood
The documentation for this class was generated from the following files: