KarmaEngine
Game Engine for practical learning and research purposes
|
Class with memory relevant functions. More...
#include <KarmaMemory.h>
Public Types | |
enum | AllocationHints { None = -1 , Default , Temporary , SmallPool , Max } |
Some allocators can be given hints to treat allocations differently depending on how the memory is used, it's lifetime etc. | |
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. | |
template<class T> | |
static FORCEINLINE void | Memset (T &Src, uint8_t ValueToSet) |
Copy value ValueToSet to template Src. | |
static FORCEINLINE void * | Memzero (void *Dest, SIZE_T Count) |
Zeros the Count number of characters of object pointed by Dest. | |
template<class T> | |
static FORCEINLINE void | Memzero (T &Src) |
Zeros the template Src. | |
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. | |
template<class T> | |
static FORCEINLINE void | Memcpy (T &Dest, const T &Src) |
Copies 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 FORCEINLINE void | Memswap (void *Ptr1, void *Ptr2, SIZE_T Size) |
static FORCEINLINE void * | SystemMalloc (SIZE_T Size) |
C style memory allocation stubs that fall back to C runtime. | |
static FORCEINLINE void | SystemFree (void *Ptr) |
C style memory deallocation. | |
static void * | Malloc (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
static FORCEINLINE void * | MallocZeroed (SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT) |
Return a zeroed block of allocated memory. | |
Class with memory relevant functions.
|
inlinestatic |
Memcpy optimized for big blocks.
Dest | Object to copy to |
Src | Object to copy from |
Count | Number of bytes to be copied |
|
inlinestatic |
Return a zeroed block of allocated memory.
Alignment | Not functional |
Count | Size in bytes to be allocated |
|
inlinestatic |
Compares first Count bytes of memory of Buf1 and Buf2.
Buf1 | A block of memory |
Buf2 | A block of memory |
Count | Number of bytes to be compared |
|
inlinestatic |
Copies from the object pointed by Src to the object pointed by Dest.
Src | Object to copy from |
Dest | Object to copy to |
|
inlinestatic |
Copies Count bytes from the object pointed by Src to the object pointed by Dest.
Src | Object to copy from |
Dest | Object to copy to |
Count | Number of bytes to be copied |
|
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.
Dest | Where to copy bytes to |
Src | Where to copy bytes from |
Count | Size of bytes to be copied |
|
inlinestatic |
Copy value ValueToSet to template Src.
Src | Copy the value to |
ValueToSet | Value to be copied |
|
inlinestatic |
Copy value Char in each of first Count characters of object pointed to by Dest.
Dest | Copy the value to |
Char | Value to be copied |
Count | Number of characters in the object to be copied to |
|
inlinestatic |
Zeros the template Src.
Src | The reference to the variable to be zeroed |
|
inlinestatic |
Zeros the Count number of characters of object pointed by Dest.
Dest | Set zeros of the object |
Count | Number of characters |
|
inlinestatic |
On some platforms memcpy can be distributed over multiple threads for throughput.
Dest | Object to copy to |
Src | Object to copy from |
Policy | Is copy result immidiately or gaply accessed by CPU |
|
inlinestatic |
On some platforms memcpy optimized for big blocks that avoid L2 cache pollution are available.
Dest | Object to copy to |
Src | Object to copy from |
Count | Number of bytes to be copied |
|
inlinestatic |
C style memory deallocation.
Ptr | Pointer to the location to be deallocated |
|
inlinestatic |
C style memory allocation stubs that fall back to C runtime.
Size | Size in bytes to be allocated |