![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GenericPlatformMallocCrash.h>
Inheritance diagram for FGenericPlatformMallocCrash:Public Types | |
| enum | { LARGE_MEMORYPOOL_SIZE = 2 * 1024 * 1024 , REQUIRED_ALIGNMENT = 16 , NUM_POOLS = 14 , MAX_NUM_ALLOCS_IN_POOL = 2048 , MEM_TAG = 0xfe , MEM_WIPETAG = 0xcd } |
Static Public Member Functions | |
| static CORE_API FGenericPlatformMallocCrash & | Get (FMalloc *MainMalloc=nullptr) |
| static bool | IsActive () |
Protected Member Functions | |
| bool | CheckThreadForAllocation () const |
| bool | CheckThreadForFree () const |
| bool | IsPtrInLargePool (void *Ptr) const |
| bool | IsPtrInSmallPool (void *Ptr) const |
| const FPoolDesc & | GetPoolDesc (uint32 Index) const |
| uint32 | CalculateSmallPoolTotalSize () const |
| uint32 | CalculateBookkeepingPoolTotalSize () const |
| void | InitializeSmallPools () |
| FMallocCrashPool * | ChoosePoolForSize (uint32 AllocationSize) const |
| FMallocCrashPool * | FindPoolForAlloc (void *Ptr) const |
| uint8 * | AllocateFromBookkeeping (uint32 AllocationSize) |
| uint8 * | AllocateFromSmallPool (uint32 AllocationSize) |
| uint64 | GetAllocationSize (void *Original) |
Protected Member Functions inherited from FExec | |
| 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) |
Static Protected Member Functions | |
| static uint32 | SafePageSize () |
Protected Attributes | |
| FCriticalSection | InternalLock |
| int32 | CrashedThreadId = 0 |
| uint8 * | LargeMemoryPool = nullptr |
| uint32 | LargeMemoryPoolOffset = 0 |
| uint8 * | SmallMemoryPool = nullptr |
| uint32 | SmallMemoryPoolOffset = 0 |
| uint32 | SmallMemoryPoolSize = 0 |
| uint8 * | BookkeepingPool = nullptr |
| uint32 | BookkeepingPoolOffset = 0 |
| uint32 | BookkeepingPoolSize = 0 |
| FMalloc * | PreviousMalloc = nullptr |
Friends | |
| struct | FPoolDesc |
| struct | FMallocCrashPool |
Additional Inherited Members | |
Static Public Attributes inherited from FMalloc | |
| static CORE_API TAtomic< uint64 > | MaxSingleAlloc |
Simple pooled memory allocator that uses preallocated memory. Instance of this class replaces GMalloc after a crash, so we can use dynamic memory allocation even if the app crashes due to OOM.
| FGenericPlatformMallocCrash::FGenericPlatformMallocCrash | ( | FMalloc * | MainMalloc | ) |
|
virtual |
|
protected |
|
protected |
|
protected |
Whether it is safe to call crash malloc's methods.
|
protected |
|
protected |
|
protected |
|
static |
Creates a new instance.
|
overridevirtual |
If possible determine the size of the memory allocated at the given address
| 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 |
Reimplemented from FMalloc.
Gets descriptive name for logging purposes.
Reimplemented from FMalloc.
Generated by the FGenericPlatformMallocCrash::PrintPoolsUsage.
|
protected |
|
static |
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.
|
protected |
Malloc
Implements FMalloc.
| void FGenericPlatformMallocCrash::PrintPoolsUsage | ( | ) |
|
overridevirtual |
Realloc
Implements FMalloc.
|
staticprotected |
| void FGenericPlatformMallocCrash::SetAsGMalloc | ( | ) |
Sets as GMalloc. This method locks to the thread that crashed. Any next calls to this method or GMalloc from other threads will dead-lock those threads, but this is ok, because we are shutting down. This also fixes a lot of potential issues of using dynamic allocation during crash dumping.
Validates the allocator's heap
Reimplemented from FMalloc.
|
friend |
|
protected |
Preallocated memory pool for bookkeeping.
|
protected |
Current position in the bookkeeping pool.
|
protected |
|
protected |
The id of the thread that crashed.
|
protected |
Used to lock crash malloc to one thread.
|
protected |
Preallocated memory pool for large allocations.
|
protected |
Current position in the large memory pool.
|
protected |
Previously used malloc.
|
protected |
Preallocated memory pool for small allocations.
|
protected |
Current position in the small memory pool.
|
protected |