diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-03-11 16:00:25 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-03-11 16:00:25 -0700 |
commit | 6ac6736994240d9789a81bf585468bef50805fd8 (patch) | |
tree | 556b213c7ef9da6fe1e423e11068b4bf584640a5 /indra/llcommon/llalignedarray.h | |
parent | 1051220d4b3b09c6cb91d25f9ddfa9eed2ccfd45 (diff) |
Move 16b aligned memcpy and alignment utilities to llmem in llcommon for easier use elsewhere
Diffstat (limited to 'indra/llcommon/llalignedarray.h')
-rw-r--r-- | indra/llcommon/llalignedarray.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index 5e04e8050f..ed8fd31205 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -29,10 +29,6 @@ #include "llmemory.h" -#if LL_WINDOWS -#include "llvector4a.h" // for 16b fast copy -#endif - template <class T, U32 alignment> class LLAlignedArray { @@ -81,11 +77,7 @@ void LLAlignedArray<T, alignment>::push_back(const T& elem) T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment); if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*)new_buf, (F32*)mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount); } old_buf = mArray; mArray = new_buf; @@ -106,11 +98,7 @@ void LLAlignedArray<T, alignment>::resize(U32 size) T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL; if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount); ll_aligned_free(mArray); } |