Commits

Anonymous committed 3bc08f2 Draft

Fix alignment_test for array allocations. Reviewed by Runitai

  • Participants
  • Parent commits 647ff55

Comments (0)

Files changed (1)

indra/llmath/tests/alignment_test.cpp

 		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);
 
 //	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<ARR_SIZE; i++)
 	{
 		MyVector4a *vecp = new MyVector4a;
 	}
 
 	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<ARR_SIZE; i++)
 	{
 		std::cout << "veca[" << i << "]" << std::endl;
 		ensure("LLAlignment veca member unaligned", is_aligned(&veca[i],16));
-	}*/
+	}
+	delete [] veca; 
 }
 
 }