15#ifdef KR_WINDOWS_PLATFORM
19#elif KR_LINUX_PLATFORM
122 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the three parameters function");
123 Memset(&Src, ValueToSet,
sizeof(T));
149 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the two parameters function");
181 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the three parameters function");
182 Memcpy(&Dest, &Src,
sizeof(T));
235 static FORCEINLINE void Memswap(
void* Ptr1,
void* Ptr2, SIZE_T Size)
237 FPlatformMemory::Memswap(Ptr1, Ptr2, Size);
249 return ::malloc(Size);
286 void* Memory = Malloc(Count, Alignment);
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
#define FORCEINLINE
Typical inlining macro for clarity.
Definition Core.h:170
@ MIN_ALIGNMENT
Minimum allocator alignment.
Definition KarmaMemory.h:39
@ DEFAULT_ALIGNMENT
Default allocator alignment. If the default is specified, the allocator applies to engine rules....
Definition KarmaMemory.h:37
unsigned int uint32
32-bit unsigned integer
Definition KarmaMemory.h:30
This file contains the class FUObjectAllocator along with the global variable declaration and several...
Class with memory relevant functions.
Definition KarmaMemory.h:46
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.
Definition KarmaMemory.h:106
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.
Definition KarmaMemory.h:214
static FORCEINLINE void * SystemMalloc(SIZE_T Size)
C style memory allocation stubs that fall back to C runtime.
Definition KarmaMemory.h:246
static FORCEINLINE void * Memzero(void *Dest, SIZE_T Count)
Zeros the Count number of characters of object pointed by Dest.
Definition KarmaMemory.h:134
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.
Definition KarmaMemory.h:165
static FORCEINLINE void Memset(T &Src, uint8_t ValueToSet)
Copy value ValueToSet to template Src.
Definition KarmaMemory.h:120
static FORCEINLINE void SystemFree(void *Ptr)
C style memory deallocation.
Definition KarmaMemory.h:258
static FORCEINLINE void * BigBlockMemcpy(void *Dest, const void *Src, SIZE_T Count)
Memcpy optimized for big blocks.
Definition KarmaMemory.h:197
static FORCEINLINE void Memzero(T &Src)
Zeros the template Src.
Definition KarmaMemory.h:147
AllocationHints
Some allocators can be given hints to treat allocations differently depending on how the memory is us...
Definition KarmaMemory.h:51
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 destina...
Definition KarmaMemory.h:76
static FORCEINLINE void Memcpy(T &Dest, const T &Src)
Copies from the object pointed by Src to the object pointed by Dest.
Definition KarmaMemory.h:179
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.
Definition KarmaMemory.h:229
static FORCEINLINE void * MallocZeroed(SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
Return a zeroed block of allocated memory.
Definition KarmaMemory.h:284
static FORCEINLINE int32_t Memcmp(const void *Buf1, const void *Buf2, SIZE_T Count)
Compares first Count bytes of memory of Buf1 and Buf2.
Definition KarmaMemory.h:91