KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::FGenericPlatformMemory Struct Reference

Base class for Platform based memory operations. More...

#include <GenericPlatformMemory.h>

Inheritance diagram for Karma::FGenericPlatformMemory:

Static Public Member Functions

static FORCEINLINE void * Memmove (void *Dest, const void *Src, SIZE_T Count)
 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.
 
static FORCEINLINE int32_t Memcmp (const void *Buf1, const void *Buf2, SIZE_T Count)
 Compares first Count bytes of memory of Buf1 and Buf2.
 
static FORCEINLINE void * Memset (void *Dest, uint8_t Char, SIZE_T Count)
 Copy value Char in each of first Count characters of object pointed to by Dest.
 
static FORCEINLINE void * Memzero (void *Dest, SIZE_T Count)
 Zeros the Count number of characters of object pointed by Dest.
 
static FORCEINLINE void * Memcpy (void *Dest, const void *Src, SIZE_T Count)
 Copies Count bytes from the object pointed by Src to the object pointed by Dest.
 
static FORCEINLINE void * BigBlockMemcpy (void *Dest, const void *Src, SIZE_T Count)
 Memcpy optimized for big blocks.
 
static FORCEINLINE 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.
 
static FORCEINLINE void * ParallelMemcpy (void *Dest, const void *Src, SIZE_T Count, EMemcpyCachePolicy Policy=EMemcpyCachePolicy::StoreCached)
 On some platforms memcpy can be distributed over multiple threads for throughput.
 
static void Memswap (void *Ptr1, void *Ptr2, SIZE_T Size)
 

Detailed Description

Base class for Platform based memory operations.

Member Function Documentation

◆ BigBlockMemcpy()

static FORCEINLINE void * Karma::FGenericPlatformMemory::BigBlockMemcpy ( void * Dest,
const void * Src,
SIZE_T Count )
inlinestatic

Memcpy optimized for big blocks.

Parameters
DestObject to copy to
SrcObject to copy from
CountNumber of bytes to be copied
See also
FGenericPlatformMemory::Memcpy
Since
Karma 1.0.0

◆ Memcmp()

static FORCEINLINE int32_t Karma::FGenericPlatformMemory::Memcmp ( const void * Buf1,
const void * Buf2,
SIZE_T Count )
inlinestatic

Compares first Count bytes of memory of Buf1 and Buf2.

Parameters
Buf1A block of memory
Buf2A block of memory
CountNumber of bytes to be compared
Since
Karma 1.0.0

◆ Memcpy()

static FORCEINLINE void * Karma::FGenericPlatformMemory::Memcpy ( void * Dest,
const void * Src,
SIZE_T Count )
inlinestatic

Copies Count bytes from the object pointed by Src to the object pointed by Dest.

Parameters
SrcObject to copy from
DestObject to copy to
CountNumber of bytes to be copied
Remarks
If both objects overlap, behavior is undefined
Since
Karma 1.0.0

◆ Memmove()

static FORCEINLINE void * Karma::FGenericPlatformMemory::Memmove ( void * Dest,
const void * Src,
SIZE_T Count )
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.

Remarks
make sure that the destination buffer is the same size or larger than the source buffer!
Parameters
DestWhere to copy bytes to
SrcWhere to copy bytes from
CountSize of bytes to be copied
Since
Karma 1.0.0

◆ Memset()

static FORCEINLINE void * Karma::FGenericPlatformMemory::Memset ( void * Dest,
uint8_t Char,
SIZE_T Count )
inlinestatic

Copy value Char in each of first Count characters of object pointed to by Dest.

Parameters
DestCopy the value to
CharValue to be copied
CountNumber of characters in the object to be copied to
Since
Karma 1.0.0

◆ Memzero()

static FORCEINLINE void * Karma::FGenericPlatformMemory::Memzero ( void * Dest,
SIZE_T Count )
inlinestatic

Zeros the Count number of characters of object pointed by Dest.

Parameters
DestSet zeros of the object
CountNumber of characters
Since
Karma 1.0.0

◆ ParallelMemcpy()

static FORCEINLINE void * Karma::FGenericPlatformMemory::ParallelMemcpy ( void * Dest,
const void * Src,
SIZE_T Count,
EMemcpyCachePolicy Policy = EMemcpyCachePolicy::StoreCached )
inlinestatic

On some platforms memcpy can be distributed over multiple threads for throughput.

Parameters
DestObject to copy to
SrcObject to copy from
PolicyIs copy result immidiately or gaply accessed by CPU
Since
Karma 1.0.0

◆ StreamingMemcpy()

static FORCEINLINE void * Karma::FGenericPlatformMemory::StreamingMemcpy ( void * Dest,
const void * Src,
SIZE_T Count )
inlinestatic

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

Parameters
DestObject to copy to
SrcObject to copy from
CountNumber of bytes to be copied
See also
FGenericPlatformMemory::Memcpy
Since
Karma 1.0.0

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