Navigation
API > API/Runtime > API/Runtime/Core
Optimized virtual memory allocator.
| Name | FMallocBinned2 |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/HAL/MallocBinned2.h |
| Include Path | #include "HAL/MallocBinned2.h" |
Syntax
class FMallocBinned2 : public TMallocBinnedCommon< FMallocBinned2, 51, >
Inheritance Hierarchy
- FExec → FMalloc → FMallocBinnedCommonBase → TMallocBinnedCommon → FMallocBinned2
- FUseSystemMallocForNew → FMalloc → FMallocBinnedCommonBase → TMallocBinnedCommon → FMallocBinned2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMallocBinned2() |
HAL/MallocBinned2.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FMallocBinned2() |
HAL/MallocBinned2.h |
Structs
| Name | Remarks |
|---|---|
| FFreeBlock | Information about a piece of free memory. |
| FPoolInfo | |
| FPoolList | |
| FPoolTable | Pool table. |
| Private |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CurrentCanary | EBlockCanary | HAL/MallocBinned2.h | |
| MallocBinned2 | FMallocBinned2 * | HAL/MallocBinned2.h | |
| MemSizeToPoolIndex | uint8 | Mapping of sizes to small table indices. | HAL/MallocBinned2.h |
| SmallBinSizes | uint16 | HAL/MallocBinned2.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SmallPoolTables | FPoolTable | Pool tables for different pool sizes. | HAL/MallocBinned2.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CachedOSPageAllocator | TCachedOSPageAllocator<(64),(16 *1024 *1024) > | HAL/MallocBinned2.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CanaryFail
(
const FFreeBlock* Block |
HAL/MallocBinned2.h | ||
void CanaryTest
(
const FFreeBlock* Block |
HAL/MallocBinned2.h | ||
void FlushCurrentThreadCacheInternal
(
bool bNewEpochOnly |
HAL/MallocBinned2.h | ||
void FreeBundles
(
FBundleNode* Bundles, |
HAL/MallocBinned2.h | ||
bool GetSmallAllocationSize
(
void* Ptr, |
HAL/MallocBinned2.h | ||
void * MallocExternalLarge
(
SIZE_T Size, |
HAL/MallocBinned2.h | ||
void * MallocExternalSmall
(
SIZE_T Size, |
HAL/MallocBinned2.h | ||
uint32 PoolIndexToBinSize
(
uint32 PoolIndex |
HAL/MallocBinned2.h |
Overridden from FMalloc
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DumpAllocatorStats
(
FOutputDevice& Ar |
Dumps current allocator stats to the log. | HAL/MallocBinned2.h | |
virtual UE_AUTORTFM_NOAUTORTFM void Free
(
void* Original |
Free | HAL/MallocBinned2.h | |
virtual bool GetAllocationSize
(
void* Original, |
If possible determine the size of the memory allocated at the given address | HAL/MallocBinned2.h | |
virtual const TCHAR * GetDescriptiveName() |
Gets descriptive name for logging purposes. | HAL/MallocBinned2.h | |
virtual uint64 GetImmediatelyFreeableCachedMemorySize() |
Returns the amount of free memory cached by the allocator that can be returned to the system in case of a memory shortage | HAL/MallocBinned2.h | |
virtual uint64 GetTotalFreeCachedMemorySize () |
Returns the amount of total free memory cached by the allocator. | HAL/MallocBinned2.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. | HAL/MallocBinned2.h | |
virtual UE_AUTORTFM_NOAUTORTFM void * Malloc
(
SIZE_T Count, |
Malloc | HAL/MallocBinned2.h | |
virtual void OnMallocInitialized() |
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 | HAL/MallocBinned2.h | |
virtual void OnPostFork() |
Notifies the malloc implementation that the process has forked so we can try and avoid dirtying pre-fork pages. | HAL/MallocBinned2.h | |
virtual void OnPreFork () |
Notifies the malloc implementation that the process is about to fork. | HAL/MallocBinned2.h | |
virtual SIZE_T QuantizeSize
(
SIZE_T Count, |
For some allocators this will return the actual size that should be requested to eliminate internal fragmentation. | HAL/MallocBinned2.h | |
virtual UE_AUTORTFM_NOAUTORTFM void * Realloc
(
void* Original, |
Realloc | HAL/MallocBinned2.h | |
virtual void Trim
(
bool bTrimThreadCaches |
Releases as much memory as possible. Must be called from the main thread. | HAL/MallocBinned2.h | |
virtual void UpdateStats () |
Called once per frame, gathers and sets all memory allocator statistics into the corresponding stats. | HAL/MallocBinned2.h | |
virtual bool ValidateHeap() |
Validates the allocator's heap | HAL/MallocBinned2.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void * AllocateMetaDataMemory
(
SIZE_T Size |
HAL/MallocBinned2.h | ||
static void FreeMetaDataMemory
(
void* Ptr, |
HAL/MallocBinned2.h | ||
static FFreeBlock * GetPoolHeaderFromPointer
(
void* Ptr |
HAL/MallocBinned2.h |