Navigation
API > API/Runtime > API/Runtime/Core
Generic implementation for most platforms, these tend to be unused and unimplemented.
| Name | FGenericPlatformMemory |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMemory.h |
| Include Path | #include "GenericPlatform/GenericPlatformMemory.h" |
Syntax
struct FGenericPlatformMemory
Derived Classes
Classes
| Name | Remarks |
|---|---|
| FBasicVirtualMemoryBlock |
Structs
| Name | Remarks |
|---|---|
| FSharedMemoryRegion | Generic representation of a shared memory region |
Enums
Public
| Name | Remarks |
|---|---|
| EMemoryAllocatorToUse | Which allocator is being used |
| EMemoryCounterRegion | Various memory regions that can be used with memory stats. |
| ESharedMemoryAccess | Flags used for shared memory creation/open |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AllocatorToUse | EMemoryAllocatorToUse | Current allocator | GenericPlatform/GenericPlatformMemory.h |
| BackupOOMMemoryPool | void * | Preallocated buffer to delete on out of memory. Used by OOM handling and crash reporting. | GenericPlatform/GenericPlatformMemory.h |
| BackupOOMMemoryPoolSize | uint32 | Size of BackupOOMMemoryPool in bytes. | GenericPlatform/GenericPlatformMemory.h |
| bIsOOM | bool | Set to true if we encounters out of memory. | GenericPlatform/GenericPlatformMemory.h |
| OOMAllocationAlignment | uint32 | Set to alignment of allocation that triggered out of memory, zero otherwise. | GenericPlatform/GenericPlatformMemory.h |
| OOMAllocationSize | uint64 | Set to size of allocation that triggered out of memory, zero otherwise. | GenericPlatform/GenericPlatformMemory.h |
| ProgramSize | uint64 | Program memory allocation in bytes. | GenericPlatform/GenericPlatformMemory.h |
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FMalloc * BaseAllocator() |
GenericPlatform/GenericPlatformMemory.h | ||
static void * BigBlockMemcpy
(
void* Dest, |
Memcpy optimized for big blocks. | GenericPlatform/GenericPlatformMemory.h | |
static void * BinnedAllocFromOS
(
SIZE_T Size |
Allocates pages from the OS. | GenericPlatform/GenericPlatformMemory.h | |
static void BinnedFreeToOS
(
void* Ptr, |
Returns pages allocated by BinnedAllocFromOS to the OS. | GenericPlatform/GenericPlatformMemory.h | |
static bool BinnedPlatformHasMemoryPoolForThisSize
(
SIZE_T Size |
Some platforms may pool allocations of this size to reduce OS calls. | GenericPlatform/GenericPlatformMemory.h | |
static bool CanOverallocateVirtualMemory() |
Return true if the platform can allocate a lot more virtual memory than physical memory It's true for most platforms, but iOS needs a special entitlement and Linux a kernel config for this | GenericPlatform/GenericPlatformMemory.h | |
static void DumpPlatformAndAllocatorStats
(
FOutputDevice& Ar |
Dumps basic platform memory statistics and allocator specific statistics into the specified output device. | GenericPlatform/GenericPlatformMemory.h | |
static void DumpStats
(
FOutputDevice& Ar |
Dumps basic platform memory statistics into the specified output device. | GenericPlatform/GenericPlatformMemory.h | |
static uint32 GetBackMemoryPoolSize() |
GenericPlatform/GenericPlatformMemory.h | ||
static const FPlatformMemoryConstants & GetConstants() |
GenericPlatform/GenericPlatformMemory.h | ||
static uint64 GetExtraDevelopmentMemorySize () |
Returns >0 if debug memory has been assigned to the title for general use. | GenericPlatform/GenericPlatformMemory.h | |
static bool GetForkedPageAllocationInfo
(
TArray< FForkedPageAllocation >& OutPageAllocationInfos |
Return the page allocations from the operating system (/proc/self/smaps). | GenericPlatform/GenericPlatformMemory.h | |
static bool GetLLMAllocFunctions
(
void*(*&)(size_t) OutAllocFunction, |
This function sets AllocFunction and FreeFunction and returns true, or just returns false. | GenericPlatform/GenericPlatformMemory.h | |
static EPlatformMemorySizeBucket GetMemorySizeBucket() |
Return which "high level", per platform, memory bucket we are in | GenericPlatform/GenericPlatformMemory.h | |
static uint64 GetMemoryUsedFast() |
GenericPlatform/GenericPlatformMemory.h | ||
static uint32 GetPhysicalGBRam() |
GenericPlatform/GenericPlatformMemory.h | ||
static uint64 GetProgramSize() |
Returns initial program size or 0 if the platform doesn't track initial program size | GenericPlatform/GenericPlatformMemory.h | |
static FPlatformMemoryStats GetStats() |
GenericPlatform/GenericPlatformMemory.h | ||
static void GetStatsForMallocProfiler
(
FGenericMemoryStats& out_Stats |
Writes all platform specific current memory statistics in the format usable by the malloc profiler. | GenericPlatform/GenericPlatformMemory.h | |
static FPlatformMemoryStats GetStatsRaw() |
GenericPlatform/GenericPlatformMemory.h | ||
static bool HasForkPageProtectorEnabled() |
Returns true if Protecting the parent processes pages has been enabled Only supported on platforms that support forking | GenericPlatform/GenericPlatformMemory.h | |
static void Init() |
Initializes platform memory specific constants. | GenericPlatform/GenericPlatformMemory.h | |
static void InternalUpdateStats
(
const FPlatformMemoryStats& MemoryStats |
Updates platform specific stats. | GenericPlatform/GenericPlatformMemory.h | |
static bool IsExtraDevelopmentMemoryAvailable () |
Returns true if debug memory has been assigned to the title for general use. | GenericPlatform/GenericPlatformMemory.h | |
static bool IsNanoMallocAvailable() |
Nano Malloc is Apple's tiny block allocator. Does the Nano malloc zone exist? | GenericPlatform/GenericPlatformMemory.h | |
static FSharedMemoryRegion * MapNamedSharedMemoryRegion
(
const FString& Name, |
Maps a named shared memory region into process address space (creates or opens it) | GenericPlatform/GenericPlatformMemory.h | |
static int32 Memcmp
(
const void* Buf1, |
GenericPlatform/GenericPlatformMemory.h | ||
static void * Memcpy
(
void* Dest, |
GenericPlatform/GenericPlatformMemory.h | ||
static void * Memmove
(
void* Dest, |
Copies count bytes of characters from Src to Dest. | GenericPlatform/GenericPlatformMemory.h | |
static void * Memset
(
void* Dest, |
GenericPlatform/GenericPlatformMemory.h | ||
static void Memswap
(
void* Ptr1, |
GenericPlatform/GenericPlatformMemory.h | ||
static void MemswapGreaterThan8
(
void* Ptr1, |
GenericPlatform/GenericPlatformMemory.h | ||
static void * Memzero
(
void* Dest, |
GenericPlatform/GenericPlatformMemory.h | ||
static void MiMallocInit () |
Performs initial setup for MiMalloc. | GenericPlatform/GenericPlatformMemory.h | |
static void NanoMallocInit() |
Performs initial setup for Nano malloc. This is a noop on non-apple platforms | GenericPlatform/GenericPlatformMemory.h | |
static void OnLowLevelMemory_Alloc
(
void const* Pointer, |
Called for all default tracker LLM allocations and frees, when LLM is enabled. | GenericPlatform/GenericPlatformMemory.h | |
static void OnLowLevelMemory_Free
(
void const* Pointer, |
GenericPlatform/GenericPlatformMemory.h | ||
static void OnOutOfMemory
(
uint64 Size, |
GenericPlatform/GenericPlatformMemory.h | ||
static bool PageProtect
(
void*const Ptr, |
Changes the protection on a region of committed pages in the virtual address space. | GenericPlatform/GenericPlatformMemory.h | |
static void * ParallelMemcpy
(
void* Dest, |
On some platforms memcpy can be distributed over multiple threads for throughput. | GenericPlatform/GenericPlatformMemory.h | |
static FString PrettyMemory
(
uint64 Memory |
Returns a pretty-string for an amount of memory given in bytes. | GenericPlatform/GenericPlatformMemory.h | |
static bool PtrIsFromNanoMalloc
(
void* Ptr |
Was this pointer allocated by in the Nano Malloc Zone? Currently only Apple platforms implement this to detect small block allocations. | GenericPlatform/GenericPlatformMemory.h | |
static bool PtrIsOSMalloc
(
void* Ptr |
Was this pointer allocated by the OS malloc? Currently only Apple platforms implement this to detect small block allocations. | GenericPlatform/GenericPlatformMemory.h | |
static T ReadUnaligned
(
const void* Ptr |
Loads a simple POD type from unaligned memory. | GenericPlatform/GenericPlatformMemory.h | |
static void RegisterCustomLLMTags() |
Called once at LLM initialization time to let the platform add any custom tags | GenericPlatform/GenericPlatformMemory.h | |
static void SetProgramSize
(
uint64 InProgramSize |
Sets the initial program size | GenericPlatform/GenericPlatformMemory.h | |
static void SetupMemoryPools() |
Initializes the memory pools, should be called by the init function. | GenericPlatform/GenericPlatformMemory.h | |
static void * StreamingMemcpy
(
void* Dest, |
On some platforms memcpy optimized for big blocks that avoid L2 cache pollution are available | GenericPlatform/GenericPlatformMemory.h | |
static bool SupportsFastVRAMMemory() |
Gets whether this platform supports Fast VRAM memory Ie, whether TexCreate_FastVRAM flags actually mean something or not | GenericPlatform/GenericPlatformMemory.h | |
static bool TracksLLMAllocations () |
Indicates whether LLM allocations are already accounted for with tracking and in GetStats. | GenericPlatform/GenericPlatformMemory.h | |
static bool UnmapNamedSharedMemoryRegion
(
FSharedMemoryRegion* MemoryRegion |
Unmaps a name shared memory region | GenericPlatform/GenericPlatformMemory.h | |
static void UpdateCustomLLMTags () |
Called once per frame when LLM is collating the data for the current frame. | GenericPlatform/GenericPlatformMemory.h | |
static void Valswap
(
T& A, |
GenericPlatform/GenericPlatformMemory.h | ||
static void WriteUnaligned
(
void* Ptr, |
Stores a simple POD type to unaligned memory. | GenericPlatform/GenericPlatformMemory.h |