17#ifdef KR_WINDOWS_PLATFORM
18#include "Platform/Windows/Core/WindowsPlatformMemory.h"
21#elif KR_LINUX_PLATFORM
124 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the three parameters function");
125 Memset(&Src, ValueToSet,
sizeof(T));
151 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the two parameters function");
183 KR_CORE_ASSERT(!TIsPointer<T>::Value,
"For pointers use the three parameters function");
184 Memcpy(&Dest, &Src,
sizeof(T));
237 static FORCEINLINE void Memswap(
void* Ptr1,
void* Ptr2, SIZE_T Size)
239 FPlatformMemory::Memswap(Ptr1, Ptr2, Size);
251 return ::malloc(Size);
288 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:157
@ MIN_ALIGNMENT
Minimum allocator alignment.
Definition KarmaMemory.h:41
@ DEFAULT_ALIGNMENT
Default allocator alignment. If the default is specified, the allocator applies to engine rules....
Definition KarmaMemory.h:39
unsigned int uint32
32-bit unsigned integer
Definition KarmaMemory.h:32
This file contains the class FUObjectAllocator along with the global variable declaration and several...
Class with memory relevant functions.
Definition KarmaMemory.h:48
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:108
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:216
static FORCEINLINE void * SystemMalloc(SIZE_T Size)
C style memory allocation stubs that fall back to C runtime.
Definition KarmaMemory.h:248
static FORCEINLINE void * Memzero(void *Dest, SIZE_T Count)
Zeros the Count number of characters of object pointed by Dest.
Definition KarmaMemory.h:136
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:167
static FORCEINLINE void Memset(T &Src, uint8_t ValueToSet)
Copy value ValueToSet to template Src.
Definition KarmaMemory.h:122
static FORCEINLINE void SystemFree(void *Ptr)
C style memory deallocation.
Definition KarmaMemory.h:260
static FORCEINLINE void * BigBlockMemcpy(void *Dest, const void *Src, SIZE_T Count)
Memcpy optimized for big blocks.
Definition KarmaMemory.h:199
static FORCEINLINE void Memzero(T &Src)
Zeros the template Src.
Definition KarmaMemory.h:149
AllocationHints
Some allocators can be given hints to treat allocations differently depending on how the memory is us...
Definition KarmaMemory.h:53
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:78
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:181
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:231
static FORCEINLINE void * MallocZeroed(SIZE_T Count, uint32 Alignment=DEFAULT_ALIGNMENT)
Return a zeroed block of allocated memory.
Definition KarmaMemory.h:286
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:93