winMemory.cpp
Engine/source/platformWin32/winMemory.cpp
Public Functions
Detailed Description
Public Functions
dFree_aligned(void * p)
dMalloc_aligned(dsize_t in_size, S32 alignment)
dMemcmp(const void * ptr1, const void * ptr2, dsize_t len)
dMemcpy(void * dst, const void * src, dsize_t size)
dMemmove(void * dst, const void * src, dsize_t size)
dMemset(void * dst, S32 c, dsize_t size)
dRealFree(void * p)
dRealMalloc(dsize_t s)
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "platformWin32/platformWin32.h" 25#include <xmmintrin.h> 26 27void* dMemcpy(void *dst, const void *src, dsize_t size) 28{ 29 return memcpy(dst,src,size); 30} 31 32 33//-------------------------------------- 34void* dMemmove(void *dst, const void *src, dsize_t size) 35{ 36 return memmove(dst,src,size); 37} 38 39//-------------------------------------- 40void* dMemset(void *dst, S32 c, dsize_t size) 41{ 42 return memset(dst,c,size); 43} 44 45//-------------------------------------- 46S32 dMemcmp(const void *ptr1, const void *ptr2, dsize_t len) 47{ 48 return memcmp(ptr1, ptr2, len); 49} 50 51#if defined(TORQUE_COMPILER_MINGW) 52#include <stdlib.h> 53#endif 54 55//-------------------------------------- 56 57void* dRealMalloc(dsize_t s) 58{ 59 return malloc(s); 60} 61 62void dRealFree(void* p) 63{ 64 free(p); 65} 66 67void *dMalloc_aligned(dsize_t in_size, S32 alignment) 68{ 69 return _mm_malloc(in_size, alignment); 70} 71 72void dFree_aligned(void* p) 73{ 74 return _mm_free(p); 75} 76