diff options
author | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-03-13 10:42:40 -0700 |
---|---|---|
committer | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-03-13 10:42:40 -0700 |
commit | 5d2fea6262d91eb8d3c06d97a160ca9373b96889 (patch) | |
tree | cee0767a4cdf64a1167ece1d5b5645d0266f9069 /indra/llcommon/llalignedarray.h | |
parent | ab60c46a917366574fa7292b6e7142ece858bec5 (diff) |
Move fast memcpy to llcommon and use it in llalignedarray pushback on all platforms. Code Review: DaveP
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); } |