Navigation
API > API/Runtime > API/Runtime/Core
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.
| Name | FGenericPlatformMallocCrash |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMallocCrash.h |
| Include Path | #include "GenericPlatform/GenericPlatformMallocCrash.h" |
Syntax
struct FGenericPlatformMallocCrash : public FMalloc
Inheritance Hierarchy
- FExec → FMalloc → FGenericPlatformMallocCrash
- FUseSystemMallocForNew → FMalloc → FGenericPlatformMallocCrash
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGenericPlatformMallocCrash
(
FMalloc* MainMalloc |
GenericPlatform/GenericPlatformMallocCrash.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FGenericPlatformMallocCrash() |
GenericPlatform/GenericPlatformMallocCrash.h |
Enums
Public
| Name | Remarks |
|---|---|
| FGenericPlatformMallocCrash |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void PrintPoolsUsage() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
void SetAsGMalloc () |
Sets as GMalloc. | GenericPlatform/GenericPlatformMallocCrash.h |
Overridden from FMalloc
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Free
(
void* Original |
Free | GenericPlatform/GenericPlatformMallocCrash.h | |
virtual bool GetAllocationSize
(
void* Original, |
If possible determine the size of the memory allocated at the given address | GenericPlatform/GenericPlatformMallocCrash.h | |
virtual const TCHAR * GetDescriptiveName() |
Gets descriptive name for logging purposes. | GenericPlatform/GenericPlatformMallocCrash.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. | GenericPlatform/GenericPlatformMallocCrash.h | |
virtual void * Malloc
(
SIZE_T Count, |
Malloc | GenericPlatform/GenericPlatformMallocCrash.h | |
virtual void * Realloc
(
void* Original, |
Realloc | GenericPlatform/GenericPlatformMallocCrash.h | |
virtual bool ValidateHeap() |
Validates the allocator's heap | GenericPlatform/GenericPlatformMallocCrash.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint8 * AllocateFromBookkeeping
(
uint32 AllocationSize |
GenericPlatform/GenericPlatformMallocCrash.h | ||
uint8 * AllocateFromSmallPool
(
uint32 AllocationSize |
GenericPlatform/GenericPlatformMallocCrash.h | ||
uint32 CalculateBookkeepingPoolTotalSize() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
uint32 CalculateSmallPoolTotalSize() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
bool CheckThreadForAllocation() |
Whether it is safe to call crash malloc's methods. | GenericPlatform/GenericPlatformMallocCrash.h | |
bool CheckThreadForFree() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
FMallocCrashPool * ChoosePoolForSize
(
uint32 AllocationSize |
Choose a pool to make a new allocation from of the given size - may use a larger pool than necessary if small pools are exhausted. | GenericPlatform/GenericPlatformMallocCrash.h | |
FMallocCrashPool * FindPoolForAlloc
(
void* Ptr |
Find the pool that an allocation was made from if any. | GenericPlatform/GenericPlatformMallocCrash.h | |
uint64 GetAllocationSize
(
void* Original |
GenericPlatform/GenericPlatformMallocCrash.h | ||
const FPoolDesc & GetPoolDesc
(
uint32 Index |
Generated by the FGenericPlatformMallocCrash::PrintPoolsUsage. | GenericPlatform/GenericPlatformMallocCrash.h | |
void InitializeSmallPools() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
bool IsPtrInLargePool
(
void* Ptr |
GenericPlatform/GenericPlatformMallocCrash.h | ||
bool IsPtrInSmallPool
(
void* Ptr |
GenericPlatform/GenericPlatformMallocCrash.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FGenericPlatformMallocCrash & Get
(
FMalloc* MainMalloc |
Creates a new instance. | GenericPlatform/GenericPlatformMallocCrash.h | |
static bool IsActive() |
GenericPlatform/GenericPlatformMallocCrash.h | ||
static uint32 SafePageSize() |
GenericPlatform/GenericPlatformMallocCrash.h |