55 #if defined(__orxGCC__) || defined(__orxLLVM__) 56 #define orxMEMORY_BARRIER() __sync_synchronize() 57 #define orxHAS_MEMORY_BARRIER 58 #elif defined(__orxMSVC__) 60 #define orxMEMORY_BARRIER() __faststorefence() 62 #define orxMEMORY_BARRIER() \ 65 _InterlockedOr(&lBarrier, 0); \ 68 #define orxHAS_MEMORY_BARRIER 70 #define orxMEMORY_BARRIER() 71 #undef orxHAS_MEMORY_BARRIER 73 #warning !!WARNING!! This compiler does not have any builtin hardware memory barrier. 78 #ifdef __orxPROFILER__ 79 #define orxMEMORY_TRACK(TYPE, SIZE, ALLOCATE) orxMemory_Track(orxMEMORY_TYPE_##TYPE, SIZE, ALLOCATE) 81 #define orxMEMORY_TRACK(TYPE, SIZE, ALLOCATE) 87 typedef enum __orxMEMORY_TYPE_t
149 static orxINLINE
void *
orxMemory_Copy(
void *_pDest,
const void *_pSrc, orxU32 _u32Size)
156 return((
void *)memcpy(_pDest, _pSrc, (
size_t)_u32Size));
165 static orxINLINE
void *
orxMemory_Move(
void *_pDest,
const void *_pSrc, orxU32 _u32Size)
172 return((
void *)memmove(_pDest, _pSrc, (
size_t)_u32Size));
181 static orxINLINE orxU32
orxMemory_Compare(
const void *_pMem1,
const void *_pMem2, orxU32 _u32Size)
188 return((orxU32)memcmp(_pMem1, _pMem2, (
size_t)_u32Size));
197 static orxINLINE
void *
orxMemory_Set(
void *_pDest, orxU8 _u8Data, orxU32 _u32Size)
203 return((
void *)memset(_pDest, _u8Data, (
size_t)_u32Size));
217 return((
void *)memset(_pDest, 0, (
size_t)_u32Size));
234 #ifdef __orxPROFILER__ 245 extern orxDLLAPI orxSTATUS orxFASTCALL orxMemory_GetUsage(
orxMEMORY_TYPE _eMemType, orxU64 *_pu64Count, orxU64 *_pu64PeakCount, orxU64 *_pu64Size, orxU64 *_pu64PeakSize, orxU64 *_pu64OperationCount);
orxDLLAPI void *orxFASTCALL orxMemory_Allocate(orxU32 _u32Size, orxMEMORY_TYPE _eMemType)
orxDLLAPI void orxFASTCALL orxMemory_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxMemory_Init()
static orxINLINE void * orxMemory_Zero(void *_pDest, orxU32 _u32Size)
static orxINLINE void * orxMemory_Set(void *_pDest, orxU8 _u8Data, orxU32 _u32Size)
orxDLLAPI const orxSTRING orxFASTCALL orxMemory_GetTypeName(orxMEMORY_TYPE _eMemType)
orxDLLAPI void orxFASTCALL orxMemory_Free(void *_pMem)
static orxINLINE void * orxMemory_Move(void *_pDest, const void *_pSrc, orxU32 _u32Size)
static orxINLINE void * orxMemory_Copy(void *_pDest, const void *_pSrc, orxU32 _u32Size)
static orxINLINE orxU32 orxMemory_Compare(const void *_pMem1, const void *_pMem2, orxU32 _u32Size)
orxDLLAPI void orxFASTCALL orxMemory_Exit()
#define orxASSERT(TEST,...)
orxDLLAPI void *orxFASTCALL orxMemory_Reallocate(void *_pMem, orxU32 _u32Size, orxMEMORY_TYPE _eMemType)
orxDLLAPI orxU32 orxFASTCALL orxMemory_GetCacheLineSize()