Ark Server API (ASA) - Wiki
|
#include <GenericPlatformMemory.h>
Classes | |
class | FBasicVirtualMemoryBlock |
struct | FSharedMemoryRegion |
Public Types | |
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 } |
enum | ESharedMemoryAccess { Read = (1 << 1) , Write = (1 << 2) } |
Generic implementation for most platforms, these tend to be unused and unimplemented.
Definition at line 207 of file GenericPlatformMemory.h.
Which allocator is being used
Enumerator | |
---|---|
Ansi | |
Stomp | |
TBB | |
Jemalloc | |
Binned | |
Binned2 | |
Binned3 | |
Platform | |
Mimalloc |
Definition at line 246 of file GenericPlatformMemory.h.
Various memory regions that can be used with memory stats. The exact meaning of the enums are relatively platform-dependent, although the general ones (Physical, GPU) are straightforward. A platform can add more of these, and it won't affect other platforms, other than a minuscule amount of memory for the StatManager to track the max available memory for each region (uses an array FPlatformMemory::MCR_MAX big)
Enumerator | |
---|---|
MCR_Invalid | |
MCR_Physical | |
MCR_GPU | |
MCR_GPUSystem | |
MCR_TexturePool | |
MCR_StreamingPool | |
MCR_UsedStreamingPool | |
MCR_GPUDefragPool | |
MCR_PhysicalLLM | |
MCR_MAX |
Definition at line 231 of file GenericPlatformMemory.h.
Flags used for shared memory creation/open
Enumerator | |
---|---|
Read | |
Write |
Definition at line 265 of file GenericPlatformMemory.h.
|
inlinestatic |
Memcpy optimized for big blocks.
Definition at line 577 of file GenericPlatformMemory.h.
Allocates pages from the OS.
Size | Size to allocate, not necessarily aligned |
Returns pages allocated by BinnedAllocFromOS to the OS.
A | pointer previously returned from BinnedAllocFromOS |
Size | size of the allocation previously passed to BinnedAllocFromOS |
|
inlinestatic |
Some platforms may pool allocations of this size to reduce OS calls. This function serves as a hint for BinnedMalloc's CachedOSPageAllocator so it does not cache these allocations additionally
Definition at line 528 of file GenericPlatformMemory.h.
|
static |
Dumps basic platform memory statistics and allocator specific statistics into the specified output device.
|
static |
Dumps basic platform memory statistics into the specified output device.
Definition at line 325 of file GenericPlatformMemory.h.
|
static |
Returns >0 if debug memory has been assigned to the title for general use. Only applies to platforms with fixed memory and no paging.
|
static |
This function sets AllocFunction and FreeFunction and returns true, or just returns false. These functions are the platform dependant low low low level functions that LLM uses to allocate memory.
|
static |
Return which "high level", per platform, memory bucket we are in
Definition at line 344 of file GenericPlatformMemory.h.
|
static |
|
static |
Writes all platform specific current memory statistics in the format usable by the malloc profiler.
Returns true if Protecting the parent processes pages has been enabled Only supported on platforms that support forking
Definition at line 780 of file GenericPlatformMemory.h.
|
staticprotected |
Updates platform specific stats. This method is called through FGenericStatsUpdater from the task graph thread.
Returns true if debug memory has been assigned to the title for general use. Only applies to platforms with fixed memory and no paging.
Nano Malloc is Apple's tiny block allocator. Does the Nano malloc zone exist?
Definition at line 430 of file GenericPlatformMemory.h.
|
static |
Maps a named shared memory region into process address space (creates or opens it)
Name | unique name of the shared memory region (should not contain [back]slashes to remain cross-platform). |
bCreate | whether we're creating it or just opening existing (created by some other process). |
AccessMode | mode which we will be accessing it (use values from ESharedMemoryAccess) |
Size | size of the buffer (should be >0. Also, the real size is subject to platform limitations and may be increased to match page size) |
|
inlinestatic |
Copies count bytes of characters from Src to Dest. If some regions of the source area and the destination overlap, memmove ensures that the original source bytes in the overlapping region are copied before being overwritten. NOTE: make sure that the destination buffer is the same size or larger than the source buffer!
Definition at line 551 of file GenericPlatformMemory.h.
|
staticprivate |
|
inlinestatic |
Performs initial setup for MiMalloc. This is a noop on platforms that do not support MiMalloc, or when MIMALLOC_ENABLED is not defined.
Definition at line 396 of file GenericPlatformMemory.h.
Performs initial setup for Nano malloc. This is a noop on non-apple platforms
Definition at line 404 of file GenericPlatformMemory.h.
|
inlinestatic |
Called for all default tracker LLM allocations and frees, when LLM is enabled. Provides a single alloc/free hook that platforms can implement to support platform specific memory analysis tools.
Definition at line 762 of file GenericPlatformMemory.h.
|
inlinestatic |
Definition at line 763 of file GenericPlatformMemory.h.
|
static |
Changes the protection on a region of committed pages in the virtual address space.
Ptr | Address to the starting page of the region of pages whose access protection attributes are to be changed. |
Size | The size of the region whose access protection attributes are to be changed, in bytes. |
bCanRead | Can the memory be read. |
bCanWrite | Can the memory be written to. |
|
inlinestatic |
On some platforms memcpy can be distributed over multiple threads for throughput.
Definition at line 589 of file GenericPlatformMemory.h.
Was this pointer allocated by in the Nano Malloc Zone? Currently only Apple platforms implement this to detect small block allocations.
The | pointer to query |
Definition at line 443 of file GenericPlatformMemory.h.
Was this pointer allocated by the OS malloc? Currently only Apple platforms implement this to detect small block allocations.
The | pointer to query |
Definition at line 417 of file GenericPlatformMemory.h.
|
inlinestatic |
Loads a simple POD type from unaligned memory.
Ptr | unaligned memory of at least size sizeof(T) |
Definition at line 691 of file GenericPlatformMemory.h.
Called once at LLM initialization time to let the platform add any custom tags
Definition at line 768 of file GenericPlatformMemory.h.
Initializes the memory pools, should be called by the init function.
|
inlinestatic |
On some platforms memcpy optimized for big blocks that avoid L2 cache pollution are available
Definition at line 583 of file GenericPlatformMemory.h.
|
inlinestatic |
Gets whether this platform supports Fast VRAM memory Ie, whether TexCreate_FastVRAM flags actually mean something or not
Definition at line 735 of file GenericPlatformMemory.h.
|
static |
Unmaps a name shared memory region
MemoryRegion | an object that encapsulates a shared memory region (will be destroyed even if function fails!) |
Called once per frame when LLM is collating the data for the current frame. Can be used to set platform-specific calculated tag data via SetTagAmountForTracker
Definition at line 774 of file GenericPlatformMemory.h.
|
inlinestaticprivate |
Definition at line 597 of file GenericPlatformMemory.h.
|
inlinestatic |
Stores a simple POD type to unaligned memory.
Ptr | unaligned memory of at least size sizeof(T) |
Value | value to write at Ptr |
Definition at line 703 of file GenericPlatformMemory.h.
Definition at line 783 of file GenericPlatformMemory.h.
|
static |
Current allocator
Definition at line 260 of file GenericPlatformMemory.h.
|
static |
Preallocated buffer to delete on out of memory. Used by OOM handling and crash reporting.
Definition at line 219 of file GenericPlatformMemory.h.
|
static |
Size of BackupOOMMemoryPool in bytes.
Definition at line 222 of file GenericPlatformMemory.h.
|
static |
Set to true if we encounters out of memory.
Definition at line 210 of file GenericPlatformMemory.h.
|
static |
Set to alignment of allocation that triggered out of memory, zero otherwise.
Definition at line 216 of file GenericPlatformMemory.h.
|
static |
Set to size of allocation that triggered out of memory, zero otherwise.
Definition at line 213 of file GenericPlatformMemory.h.