From cd315c0ecdf0dbcc6a5fb18d60cbb31ee06e9acd Mon Sep 17 00:00:00 2001 From: "simon@Simon-PC.lindenlab.com" Date: Wed, 12 Sep 2012 16:00:12 -0700 Subject: Fix alignment_test for array allocations. Reviewed by Runitai --- indra/llmath/tests/alignment_test.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/llmath/tests') diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index 289d25a63c..bbc68fc498 100644 --- a/indra/llmath/tests/alignment_test.cpp +++ b/indra/llmath/tests/alignment_test.cpp @@ -60,6 +60,16 @@ public: 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); @@ -112,7 +122,7 @@ void alignment_test_object_t::test<3>() // skip("This test fails on Windows when compiled in debug mode."); # endif - /*const int ARR_SIZE = 7; + const int ARR_SIZE = 7; for(int i=0; i() } MyVector4a *veca = new MyVector4a[ARR_SIZE]; + //std::cout << "veca base is " << (S32) veca << std::endl; ensure("LLAligment veca base", is_aligned(veca,16)); for(int i=0; i