UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FApplePlatformMemory Struct Reference

#include <ApplePlatformMemory.h>

+ Inheritance diagram for FApplePlatformMemory:

Classes

class  FPlatformVirtualMemoryBlock
 

Static Public Member Functions

static void Init ()
 
static FPlatformMemoryStats GetStats ()
 
static uint64 GetMemoryUsedFast ()
 
static const FPlatformMemoryConstantsGetConstants ()
 
static FMallocBaseAllocator ()
 
static bool PageProtect (void *const Ptr, const SIZE_T Size, const bool bCanRead, const bool bCanWrite)
 
static voidBinnedAllocFromOS (SIZE_T Size)
 
static void BinnedFreeToOS (void *Ptr, SIZE_T Size)
 
static bool PtrIsOSMalloc (void *Ptr)
 
static bool PtrIsFromNanoMalloc (void *Ptr)
 
static bool IsNanoMallocAvailable ()
 
static void NanoMallocInit ()
 
static void SetAllocatorToUse ()
 
static bool GetLLMAllocFunctions (void *_Nonnull(*_Nonnull &OutAllocFunction)(size_t), void(*_Nonnull &OutFreeFunction)(void *, size_t), int32 &OutAlignment)
 
static void OnLowLevelMemory_Alloc (void const *Pointer, uint64 Size, uint64 Tag)
 
static void OnLowLevelMemory_Free (void const *Pointer, uint64 Size, uint64 Tag)
 
static void ConfigureDefaultCFAllocator (void)
 
static bool CanOverallocateVirtualMemory ()
 
- Static Public Member Functions inherited from FGenericPlatformMemory
static CORE_API void Init ()
 
static CORE_API void OnOutOfMemory (uint64 Size, uint32 Alignment)
 
static CORE_API void SetupMemoryPools ()
 
static uint32 GetBackMemoryPoolSize ()
 
static CORE_API FMallocBaseAllocator ()
 
static CORE_API FPlatformMemoryStats GetStats ()
 
static CORE_API FPlatformMemoryStats GetStatsRaw ()
 
static CORE_API uint64 GetMemoryUsedFast ()
 
static CORE_API void GetStatsForMallocProfiler (FGenericMemoryStats &out_Stats)
 
static CORE_API const FPlatformMemoryConstantsGetConstants ()
 
static CORE_API uint32 GetPhysicalGBRam ()
 
static CORE_API bool PageProtect (void *const Ptr, const SIZE_T Size, const bool bCanRead, const bool bCanWrite)
 
static CORE_API voidBinnedAllocFromOS (SIZE_T Size)
 
static CORE_API void BinnedFreeToOS (void *Ptr, SIZE_T Size)
 
static void MiMallocInit ()
 
static void NanoMallocInit ()
 
static bool PtrIsOSMalloc (void *Ptr)
 
static bool IsNanoMallocAvailable ()
 
static bool PtrIsFromNanoMalloc (void *Ptr)
 
static bool BinnedPlatformHasMemoryPoolForThisSize (SIZE_T Size)
 
static CORE_API void DumpStats (FOutputDevice &Ar)
 
static CORE_API void DumpPlatformAndAllocatorStats (FOutputDevice &Ar)
 
static CORE_API EPlatformMemorySizeBucket GetMemorySizeBucket ()
 
static UE_FORCEINLINE_HINT voidMemmove (void *Dest, const void *Src, SIZE_T Count)
 
static UE_FORCEINLINE_HINT int32 Memcmp (const void *Buf1, const void *Buf2, SIZE_T Count)
 
static UE_FORCEINLINE_HINT voidMemset (void *Dest, uint8 Char, SIZE_T Count)
 
static UE_FORCEINLINE_HINT voidMemzero (void *Dest, SIZE_T Count)
 
static UE_FORCEINLINE_HINT voidMemcpy (void *Dest, const void *Src, SIZE_T Count)
 
static UE_FORCEINLINE_HINT voidBigBlockMemcpy (void *Dest, const void *Src, SIZE_T Count)
 
static UE_FORCEINLINE_HINT voidStreamingMemcpy (void *Dest, const void *Src, SIZE_T Count)
 
static voidParallelMemcpy (void *Dest, const void *Src, SIZE_T Count, EMemcpyCachePolicy Policy=EMemcpyCachePolicy::StoreCached)
 
static void Memswap (void *Ptr1, void *Ptr2, SIZE_T Size)
 
template<typename T >
staticReadUnaligned (const void *Ptr)
 
template<typename T >
static UE_FORCEINLINE_HINT void WriteUnaligned (void *Ptr, const T &InValue)
 
static CORE_API FSharedMemoryRegionMapNamedSharedMemoryRegion (const FString &Name, bool bCreate, uint32 AccessMode, SIZE_T Size)
 
static CORE_API bool UnmapNamedSharedMemoryRegion (FSharedMemoryRegion *MemoryRegion)
 
static UE_FORCEINLINE_HINT bool SupportsFastVRAMMemory ()
 
static CORE_API bool IsExtraDevelopmentMemoryAvailable ()
 
static CORE_API uint64 GetExtraDevelopmentMemorySize ()
 
static uint64 GetProgramSize ()
 
static void SetProgramSize (uint64 InProgramSize)
 
static CORE_API bool GetLLMAllocFunctions (void *(*&OutAllocFunction)(size_t), void(*&OutFreeFunction)(void *, size_t), int32 &OutAlignment)
 
static UE_FORCEINLINE_HINT void OnLowLevelMemory_Alloc (void const *Pointer, uint64 Size, uint64 Tag)
 
static UE_FORCEINLINE_HINT void OnLowLevelMemory_Free (void const *Pointer, uint64 Size, uint64 Tag)
 
static void RegisterCustomLLMTags ()
 
static void UpdateCustomLLMTags ()
 
static bool TracksLLMAllocations ()
 
static bool HasForkPageProtectorEnabled ()
 
static bool GetForkedPageAllocationInfo (TArray< FForkedPageAllocation > &OutPageAllocationInfos)
 
static CORE_API FString PrettyMemory (uint64 Memory)
 
static UE_FORCEINLINE_HINT bool CanOverallocateVirtualMemory ()
 

Static Public Attributes

static vm_address_t NanoRegionStart = 0
 
static vm_address_t NanoRegionEnd = 0
 
- Static Public Attributes inherited from FGenericPlatformMemory
static CORE_API bool bIsOOM = false
 
static CORE_API uint64 OOMAllocationSize = 0
 
static CORE_API uint32 OOMAllocationAlignment = 0
 
static CORE_API voidBackupOOMMemoryPool = nullptr
 
static CORE_API uint32 BackupOOMMemoryPoolSize
 
static CORE_API EMemoryAllocatorToUse AllocatorToUse = Platform
 

Additional Inherited Members

- Public Types inherited from FGenericPlatformMemory
enum  EMemoryCounterRegion {
  MCR_Invalid , MCR_Physical , MCR_GPU , MCR_GPUSystem ,
  MCR_TexturePool , MCR_StreamingPool , MCR_UsedStreamingPool , MCR_GPUDefragPool ,
  MCR_PhysicalLLM , MCR_MAX
}
 
enum  EMemoryAllocatorToUse {
  Ansi , Stomp , TBB , Jemalloc ,
  Binned , Binned2 , Binned3 , Platform ,
  Mimalloc , Libpas
}
 
enum  ESharedMemoryAccess { Read = (1 << 1) , Write = (1 << 2) }
 
- Static Protected Member Functions inherited from FGenericPlatformMemory
static CORE_API void InternalUpdateStats (const FPlatformMemoryStats &MemoryStats)
 
- Static Protected Attributes inherited from FGenericPlatformMemory
static CORE_API uint64 ProgramSize = 0
 

Detailed Description

Common Apple platform memory functions.

Member Function Documentation

◆ BaseAllocator()

FMalloc * FApplePlatformMemory::BaseAllocator ( )
static

◆ BinnedAllocFromOS()

void *_Nullable FApplePlatformMemory::BinnedAllocFromOS ( SIZE_T  Size)
static

◆ BinnedFreeToOS()

void FApplePlatformMemory::BinnedFreeToOS ( void Ptr,
SIZE_T  Size 
)
static

◆ CanOverallocateVirtualMemory()

bool FApplePlatformMemory::CanOverallocateVirtualMemory ( )
static

◆ ConfigureDefaultCFAllocator()

void FApplePlatformMemory::ConfigureDefaultCFAllocator ( void  )
static

Setup the current default CFAllocator to use our malloc functions.

◆ GetConstants()

const FPlatformMemoryConstants & FApplePlatformMemory::GetConstants ( )
static

◆ GetLLMAllocFunctions()

bool FApplePlatformMemory::GetLLMAllocFunctions ( void *_Nonnull(*&)(size_t OutAllocFunction,
void(*&)(void *, size_t OutFreeFunction,
int32 OutAlignment 
)
static

LLM uses these low level functions (LLMAlloc and LLMFree) to allocate memory. It grabs the function pointers by calling FPlatformMemory::GetLLMAllocFunctions. If these functions are not implemented GetLLMAllocFunctions should return false and LLM will be disabled.

◆ GetMemoryUsedFast()

uint64 FApplePlatformMemory::GetMemoryUsedFast ( )
static

◆ GetStats()

FPlatformMemoryStats FApplePlatformMemory::GetStats ( )
static

◆ Init()

void FApplePlatformMemory::Init ( )
static

◆ IsNanoMallocAvailable()

bool FApplePlatformMemory::IsNanoMallocAvailable ( )
static

◆ NanoMallocInit()

void FApplePlatformMemory::NanoMallocInit ( )
static

◆ OnLowLevelMemory_Alloc()

static void FApplePlatformMemory::OnLowLevelMemory_Alloc ( void const *  Pointer,
uint64  Size,
uint64  Tag 
)
static

◆ OnLowLevelMemory_Free()

static void FApplePlatformMemory::OnLowLevelMemory_Free ( void const *  Pointer,
uint64  Size,
uint64  Tag 
)
static

◆ PageProtect()

bool FApplePlatformMemory::PageProtect ( void *const  Ptr,
const SIZE_T  Size,
const bool  bCanRead,
const bool  bCanWrite 
)
static

◆ PtrIsFromNanoMalloc()

bool FApplePlatformMemory::PtrIsFromNanoMalloc ( void Ptr)
static

◆ PtrIsOSMalloc()

bool FApplePlatformMemory::PtrIsOSMalloc ( void Ptr)
static

◆ SetAllocatorToUse()

void FApplePlatformMemory::SetAllocatorToUse ( )
static

Member Data Documentation

◆ NanoRegionEnd

vm_address_t FApplePlatformMemory::NanoRegionEnd = 0
static

◆ NanoRegionStart

vm_address_t FApplePlatformMemory::NanoRegionStart = 0
static

The documentation for this struct was generated from the following files: