FGenericPlatformMemory

Inheritance Hierarchy

FGenericPlatformMemory

FUnixPlatformMemory

Syntax

struct FGenericPlatformMemory

Remarks

Generic implementation for most platforms, these tend to be unused and unimplemented.

Functions

Name Description

Public function

struct

 

attribute

(
    (packed)
)

Assume it is either clang or something that supports the clang attributes

Public function Static

FMalloc *...

 

BaseAllocator()

Public function Static

void *

 

BigBlockMemcpy

(
    void* Dest,
    const void* Src,
    SIZE_T Count
)

Memcpy optimized for big blocks.

Public function Static

void *

 

BinnedAllocFromOS

(
    SIZE_T Size
)

Allocates pages from the OS.

Public function Static

void

 

BinnedFreeToOS

(
    void* Ptr,
    SIZE_T Size
)

Returns pages allocated by BinnedAllocFromOS to the OS.

Public function Static

bool

 

BinnedPlatformHasMemoryPoolForThisSize

(
    SIZE_T Size
)

Some platforms may pool allocations of this size to reduce OS calls.

Public function Static

void

 

DumpPlatformAndAllocatorStats

(
    FOutputDevice & Ar
)

Dumps basic platform memory statistics and allocator specific statistics into the specified output device.

Public function Static

void

 

DumpStats

(
    FOutputDevice & Ar
)

Dumps basic platform memory statistics into the specified output device.

Public function Static

uint32

 

GetBackMemoryPoolSize()

Public function Static

const FPlatf ...

 

GetConstants()

Public function Static

bool

 

GetLLMAllocFunctions

(
    void*(*&)(size_t) OutAlloc...,
    void(*&)(void*, size_t) Ou...,
    int32 & OutAlignment
)

This function sets AllocFunction and FreeFunction and returns true, or just returns false.

Public function Static

EPlatformMem ...

 

GetMemorySizeBucket()

Return which "high level", per platform, memory bucket we are in

Public function Static

uint64

 

GetMemoryUsedFast()

Public function Static

uint32

 

GetPhysicalGBRam()

Public function Static

FPlatformMem ...

 

GetStats()

Public function Static

void

 

GetStatsForMallocProfiler

(
    FGenericMemoryStats & out_Stats
)

Writes all platform specific current memory statistics in the format usable by the malloc profiler.

Public function Static

void

 

GPUFree

(
    void* Original
)

Public function Static

void *

 

GPUMalloc

(
    SIZE_T Count,
    uint32 Alignment
)

These alloc/free memory that is mapped to the GPU Only for platforms with UMA (XB1/PS4/etc)

Public function Static

void *

 

GPURealloc

(
    void* Original,
    SIZE_T Count,
    uint32 Alignment
)

Public function Static

void

 

Init()

Initializes platform memory specific constants.

Protected function Static

void

 

InternalUpdateStats

(
    const FPlatformMemoryStats & Memory...
)

Updates platform specific stats.

Public function Static

bool

 

IsExtraDevelopmentMemoryAvailable()

Returns true if debug memory has been assigned to the title for general use.

Public function Static

FSharedMemor ...

 

MapNamedSharedMemoryRegion

(
    const FString & Name,
    bool bCreate,
    uint32 AccessMode,
    SIZE_T Size
)

Maps a named shared memory region into process address space (creates or opens it)

Public function Static

int32

 

Memcmp

(
    const void* Buf1,
    const void* Buf2,
    SIZE_T Count
)

Public function Static

void *

 

Memcpy

(
    void* Dest,
    const void* Src,
    SIZE_T Count
)

Public function Static

void *

 

Memmove

(
    void* Dest,
    const void* Src,
    SIZE_T Count
)

Copies count bytes of characters from Src to Dest.

Public function Static

bool

 

MemoryRangeCommit

(
    void* Ptr,
    SIZE_T Size
)

Commits a virtual memory range.

Public function Static

bool

 

MemoryRangeDecommit

(
    void* Ptr,
    SIZE_T Size
)

Decommits a virtual memory range.

Public function Static

void

 

MemoryRangeFree

(
    void* Ptr,
    SIZE_T Size
)

Frees a virtual memory range.

Public function Static

void *

 

MemoryRangeReserve

(
    SIZE_T Size,
    bool bCommit,
    int32 Node
)

Reserves a virtual memory range.

Public function Static

void *

 

Memset

(
    void* Dest,
    uint8 Char,
    SIZE_T Count
)

Public function Static

void

 

Memswap

(
    void* Ptr1,
    void* Ptr2,
    SIZE_T Size
)

Public function Static

void *

 

Memzero

(
    void* Dest,
    SIZE_T Count
)

Public function Static

void

 

OnLowLevelMemory_Alloc

(
    void const* Pointer,
    uint64 Size,
    uint64 Tag
)

Called for all default tracker LLM allocations and frees, when LLM is enabled.

Public function Static

void

 

OnLowLevelMemory_Free

(
    void const* Pointer,
    uint64 Size,
    uint64 Tag
)

Public function Static

void

 

OnOutOfMemory

(
    uint64 Size,
    uint32 Alignment
)

Public function Static

bool

 

PageProtect

(
    void*const Ptr,
    const SIZE_T Size,
    const bool bCanRead,
    const bool bCanWrite
)

Changes the protection on a region of committed pages in the virtual address space.

Public function Static

T

 

ReadUnaligned

(
    const void* Ptr
)

Loads a simple POD type from unaligned memory.

Public function Static

void

 

SetupMemoryPools()

Initializes the memory pools, should be called by the init function.

Public function Static

void *

 

StreamingMemcpy

(
    void* Dest,
    const void* Src,
    SIZE_T Count
)

On some platforms memcpy optimized for big blocks that avoid L2 cache pollution are available

Public function Static

bool

 

SupportsFastVRAMMemory()

Gets whether this platform supports Fast VRAM memory Ie, whether TexCreate_FastVRAM flags actually mean something or not

Public function Static

bool

 

UnmapNamedSharedMemoryRegion

(
    FSharedMemoryRegion * MemoryReg...
)

Unmaps a name shared memory region

Public function Static

void

 

WriteUnaligned

(
    void* Ptr,
    const T& InValue
)

Stores a simple POD type to unaligned memory.

Classes

Name

Description

Public struct

FSharedMemoryRegion

Generic representation of a shared memory region

Enums

Name

Description

Public enum

EMemoryAllocatorToUse

Which allocator is being used

Public enum

EMemoryCounterRegion

Various memory regions that can be used with memory stats.

Public enum

ESharedMemoryAccess

Flags used for shared memory creation/open

Constants

Name

Description

AllocatorToUse

Current allocator

BackupOOMMemoryPool

Preallocated buffer to delete on out of memory. Used by OOM handling and crash reporting.

BackupOOMMemoryPoolSize

Size of BackupOOMMemoryPool in bytes.

bIsOOM

Set to true if we encounters out of memory.

OOMAllocationAlignment

Set to alignment of allocation that triggered out of memory, zero otherwise.

OOMAllocationSize

Set to size of allocation that triggered out of memory, zero otherwise.

References

Module

Core

Header

Runtime/Core/Public/GenericPlatform/GenericPlatformMemory.h