diff options
author | Dave Parks <davep@lindenlab.com> | 2012-09-13 20:31:22 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-09-13 20:31:22 -0500 |
commit | 8f7bb8f6d58dfa1d0b160948b2ca790cd6d4ae5c (patch) | |
tree | 34c7b4453e4e6c546294ba2b45e538ede27a1276 /indra/llmath | |
parent | 3a36e3c6a82462b8d01e47707391be168e739b66 (diff) |
Port over Simon's fix for alignment test
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/tests/alignment_test.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index 5c426c57c3..9105b1c1fd 100644 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -34,16 +34,6 @@ #include "../llsimdmath.h" #include "../llvector4a.h" -void* operator new(size_t size) -{ - return ll_aligned_malloc_16(size); -} - -void operator delete(void *p) -{ - ll_aligned_free_16(p); -} - namespace tut { @@ -59,6 +49,27 @@ tut::alignment_test_t tut_alignment_test("LLAlignment"); LL_ALIGN_PREFIX(16) class MyVector4a { +public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void *p) + { + ll_aligned_free_16(p); + } + + void* operator new[](size_t count) + { // try to allocate count bytes for an array + return ll_aligned_malloc_16(count); + } + + void operator delete[](void *p) + { + ll_aligned_free_16(p); + } + LLQuad mQ; } LL_ALIGN_POSTFIX(16); |