diff options
Diffstat (limited to 'indra/llmath')
93 files changed, 64 insertions, 359 deletions
| diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 5865ae030c..0614fd92ef 100644..100755 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -7,6 +7,7 @@ include(LLCommon)  include_directories(      ${LLCOMMON_INCLUDE_DIRS} +    ${LLCOMMON_SYSTEM_INCLUDE_DIRS}      )  set(llmath_SOURCE_FILES @@ -99,6 +100,10 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES})  add_library (llmath ${llmath_SOURCE_FILES}) +target_link_libraries(llmath +    ${LLCOMMON_LIBRARIES} +    ) +  # Add tests  if (LL_TESTS)    include(LLAddBuildTest) diff --git a/indra/llmath/camera.h b/indra/llmath/camera.h index 26f3c3d19f..26f3c3d19f 100644..100755 --- a/indra/llmath/camera.h +++ b/indra/llmath/camera.h diff --git a/indra/llmath/coordframe.h b/indra/llmath/coordframe.h index 271bcb433c..271bcb433c 100644..100755 --- a/indra/llmath/coordframe.h +++ b/indra/llmath/coordframe.h diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp index 3e2c05a6e6..3e2c05a6e6 100644..100755 --- a/indra/llmath/llbbox.cpp +++ b/indra/llmath/llbbox.cpp diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h index 28e69b75e1..28e69b75e1 100644..100755 --- a/indra/llmath/llbbox.h +++ b/indra/llmath/llbbox.h diff --git a/indra/llmath/llbboxlocal.cpp b/indra/llmath/llbboxlocal.cpp index bf0c1a7b93..bf0c1a7b93 100644..100755 --- a/indra/llmath/llbboxlocal.cpp +++ b/indra/llmath/llbboxlocal.cpp diff --git a/indra/llmath/llbboxlocal.h b/indra/llmath/llbboxlocal.h index defb899248..defb899248 100644..100755 --- a/indra/llmath/llbboxlocal.h +++ b/indra/llmath/llbboxlocal.h diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp index 1b2d609b67..1b2d609b67 100644..100755 --- a/indra/llmath/llcalc.cpp +++ b/indra/llmath/llcalc.cpp diff --git a/indra/llmath/llcalc.h b/indra/llmath/llcalc.h index ceb9dce585..ceb9dce585 100644..100755 --- a/indra/llmath/llcalc.h +++ b/indra/llmath/llcalc.h diff --git a/indra/llmath/llcalcparser.cpp b/indra/llmath/llcalcparser.cpp index b4ca320659..b4ca320659 100644..100755 --- a/indra/llmath/llcalcparser.cpp +++ b/indra/llmath/llcalcparser.cpp diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index e0ad270266..e0ad270266 100644..100755 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp index 22ba26f99b..22ba26f99b 100644..100755 --- a/indra/llmath/llcamera.cpp +++ b/indra/llmath/llcamera.cpp diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 0b591be622..0b591be622 100644..100755 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h index 9b76268afd..9b76268afd 100644..100755 --- a/indra/llmath/llcoord.h +++ b/indra/llmath/llcoord.h diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp index 7dd8e43185..7dd8e43185 100644..100755 --- a/indra/llmath/llcoordframe.cpp +++ b/indra/llmath/llcoordframe.cpp diff --git a/indra/llmath/llcoordframe.h b/indra/llmath/llcoordframe.h index 909adf260c..909adf260c 100644..100755 --- a/indra/llmath/llcoordframe.h +++ b/indra/llmath/llcoordframe.h diff --git a/indra/llmath/llinterp.h b/indra/llmath/llinterp.h index 5187646179..5187646179 100644..100755 --- a/indra/llmath/llinterp.h +++ b/indra/llmath/llinterp.h diff --git a/indra/llmath/llline.cpp b/indra/llmath/llline.cpp index ef10d1e7fa..ef10d1e7fa 100644..100755 --- a/indra/llmath/llline.cpp +++ b/indra/llmath/llline.cpp diff --git a/indra/llmath/llline.h b/indra/llmath/llline.h index e1cbc1323e..e1cbc1323e 100644..100755 --- a/indra/llmath/llline.h +++ b/indra/llmath/llline.h diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index b93f89d674..b93f89d674 100644..100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h diff --git a/indra/llmath/llmatrix3a.cpp b/indra/llmath/llmatrix3a.cpp index ab077abcb0..ab077abcb0 100644..100755 --- a/indra/llmath/llmatrix3a.cpp +++ b/indra/llmath/llmatrix3a.cpp diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index 9916cfd2da..9916cfd2da 100644..100755 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h diff --git a/indra/llmath/llmatrix3a.inl b/indra/llmath/llmatrix3a.inl index 37819fea3c..37819fea3c 100644..100755 --- a/indra/llmath/llmatrix3a.inl +++ b/indra/llmath/llmatrix3a.inl diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index c4cefdb4fa..c4cefdb4fa 100644..100755 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h diff --git a/indra/llmath/llmodularmath.cpp b/indra/llmath/llmodularmath.cpp index cdc20028bf..cdc20028bf 100644..100755 --- a/indra/llmath/llmodularmath.cpp +++ b/indra/llmath/llmodularmath.cpp diff --git a/indra/llmath/llmodularmath.h b/indra/llmath/llmodularmath.h index 0d4d28fadc..0d4d28fadc 100644..100755 --- a/indra/llmath/llmodularmath.h +++ b/indra/llmath/llmodularmath.h diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index c3f6f7de2a..7348904c61 100644..100755 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -78,7 +78,7 @@ public:  	typedef LLOctreeTraveler<T>									oct_traveler;  	typedef LLTreeTraveler<T>									tree_traveler; -	typedef LLPointer<T>*										element_list; +	typedef std::vector< LLPointer<T> >							element_list;		// note:  don't remove the whitespace between "> >"  	typedef LLPointer<T>*										element_iter;  	typedef const LLPointer<T>*									const_element_iter;  	typedef typename std::vector<LLTreeListener<T>*>::iterator	tree_listener_iter; @@ -106,8 +106,9 @@ public:  	:	mParent((oct_node*)parent),   		mOctant(octant)   	{  -		mData = NULL; -		mDataEnd = NULL; +		//always keep a NULL terminated list to avoid out of bounds exceptions in debug builds +		mData.push_back(NULL); +		mDataEnd = &mData[0];  		mCenter = center;  		mSize = size; @@ -133,9 +134,9 @@ public:  			mData[i] = NULL;  		} -		free(mData); -		mData = NULL; -		mDataEnd = NULL; +		mData.clear(); +		mData.push_back(NULL); +		mDataEnd = &mData[0];  		for (U32 i = 0; i < getChildCount(); i++)  		{ @@ -239,9 +240,9 @@ public:  	bool isEmpty() const							{ return mElementCount == 0; }  	element_list& getData()							{ return mData; }  	const element_list& getData() const				{ return mData; } -	element_iter getDataBegin()						{ return mData; } +	element_iter getDataBegin()						{ return &mData[0]; }  	element_iter getDataEnd()						{ return mDataEnd; } -	const_element_iter getDataBegin() const			{ return mData; } +	const_element_iter getDataBegin() const			{ return &mData[0]; }  	const_element_iter getDataEnd() const			{ return mDataEnd; }  	U32 getChildCount()	const						{ return mChildCount; } @@ -321,14 +322,10 @@ public:  			if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) ||  				(data->getBinRadius() > getSize()[0] &&	parent && parent->getElementCount() >= gOctreeMaxCapacity)))   			{ //it belongs here +				mData.push_back(NULL); +				mData[mElementCount] = data;  				mElementCount++; -				mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount); - -				//avoid unref on uninitialized memory -				memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>)); - -				mData[mElementCount-1] = data; -				mDataEnd = mData + mElementCount; +				mDataEnd = &mData[mElementCount];  				data->setBinIndex(mElementCount-1);  				BaseType::insert(data);  				return true; @@ -364,14 +361,10 @@ public:  				if( lt == 0x7 )  				{ +					mData.push_back(NULL); +					mData[mElementCount] = data;  					mElementCount++; -					mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount); - -					//avoid unref on uninitialized memory -					memset(mData+mElementCount-1, 0, sizeof(LLPointer<T>)); - -					mData[mElementCount-1] = data; -					mDataEnd = mData + mElementCount; +					mDataEnd = &mData[mElementCount];  					data->setBinIndex(mElementCount-1);  					BaseType::insert(data);  					return true; @@ -436,16 +429,15 @@ public:  				mData[i]->setBinIndex(i);  			} -			mData[mElementCount] = NULL; //needed for unref -			mData = (element_list) realloc(mData, sizeof(LLPointer<T>)*mElementCount); -			mDataEnd = mData+mElementCount; +			mData[mElementCount] = NULL; +			mData.pop_back(); +			mDataEnd = &mData[mElementCount];  		}  		else  		{ -			mData[0] = NULL; //needed for unref -			free(mData); -			mData = NULL; -			mDataEnd = NULL; +			mData.clear(); +			mData.push_back(NULL); +			mDataEnd = &mData[0];  		}  		notifyRemoval(data); @@ -491,7 +483,7 @@ public:  		}  		//node is now root -		llwarns << "!!! OCTREE REMOVING FACE BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl; +		llwarns << "!!! OCTREE REMOVING ELEMENT BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl;  		node->removeByAddress(data);  		llassert(data->getBinIndex() == -1);  		return true; diff --git a/indra/llmath/llperlin.cpp b/indra/llmath/llperlin.cpp index e1da2bf92b..e1da2bf92b 100644..100755 --- a/indra/llmath/llperlin.cpp +++ b/indra/llmath/llperlin.cpp diff --git a/indra/llmath/llperlin.h b/indra/llmath/llperlin.h index 40cf19d1ec..40cf19d1ec 100644..100755 --- a/indra/llmath/llperlin.h +++ b/indra/llmath/llperlin.h diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h index 3c32441b11..3c32441b11 100644..100755 --- a/indra/llmath/llplane.h +++ b/indra/llmath/llplane.h diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index 1595dbecf8..1595dbecf8 100644..100755 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 7381d5eb99..7381d5eb99 100644..100755 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index ca0dfe206b..ca0dfe206b 100644..100755 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index fd9c0cf3ab..fd9c0cf3ab 100644..100755 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h diff --git a/indra/llmath/llquaternion2.inl b/indra/llmath/llquaternion2.inl index 2a6987552d..2a6987552d 100644..100755 --- a/indra/llmath/llquaternion2.inl +++ b/indra/llmath/llquaternion2.inl diff --git a/indra/llmath/llrect.cpp b/indra/llmath/llrect.cpp index 4083c99768..4083c99768 100644..100755 --- a/indra/llmath/llrect.cpp +++ b/indra/llmath/llrect.cpp diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index c51e0e0ae6..c51e0e0ae6 100644..100755 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h diff --git a/indra/llmath/llsdutil_math.cpp b/indra/llmath/llsdutil_math.cpp index 591f7fde36..591f7fde36 100644..100755 --- a/indra/llmath/llsdutil_math.cpp +++ b/indra/llmath/llsdutil_math.cpp diff --git a/indra/llmath/llsdutil_math.h b/indra/llmath/llsdutil_math.h index 0ea78cd231..0ea78cd231 100644..100755 --- a/indra/llmath/llsdutil_math.h +++ b/indra/llmath/llsdutil_math.h diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 01458521ec..01458521ec 100644..100755 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index bd991d0e71..bd991d0e71 100644..100755 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h diff --git a/indra/llmath/llsimdtypes.inl b/indra/llmath/llsimdtypes.inl index e905c84954..e905c84954 100644..100755 --- a/indra/llmath/llsimdtypes.inl +++ b/indra/llmath/llsimdtypes.inl diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp index 740047b93a..740047b93a 100644..100755 --- a/indra/llmath/llsphere.cpp +++ b/indra/llmath/llsphere.cpp diff --git a/indra/llmath/llsphere.h b/indra/llmath/llsphere.h index 7c60a11406..7c60a11406 100644..100755 --- a/indra/llmath/llsphere.h +++ b/indra/llmath/llsphere.h diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h index c66bc26176..c66bc26176 100644..100755 --- a/indra/llmath/lltreenode.h +++ b/indra/llmath/lltreenode.h diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 6edeb0fefe..6edeb0fefe 100644..100755 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 0526793d3a..0526793d3a 100644..100755 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 7c52ffef21..7c52ffef21 100644..100755 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h index c5698f7cea..c5698f7cea 100644..100755 --- a/indra/llmath/llvector4logical.h +++ b/indra/llmath/llvector4logical.h diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 53d56e96da..3f06e6b99e 100644..100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -35,7 +35,6 @@  #include <cmath>  #include "llerror.h" -#include "llmemtype.h"  #include "llvolumemgr.h"  #include "v2math.h" @@ -378,8 +377,6 @@ public:  LLProfile::Face* LLProfile::addCap(S16 faceID)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	Face *face   = vector_append(mFaces, 1);  	face->mIndex = 0; @@ -392,8 +389,6 @@ LLProfile::Face* LLProfile::addCap(S16 faceID)  LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BOOL flat)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	Face *face   = vector_append(mFaces, 1);  	face->mIndex = i; @@ -409,7 +404,6 @@ LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BO  //static  S32 LLProfile::getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 offset, F32 bevel, F32 ang_scale, S32 split)  { // this is basically LLProfile::genNGon stripped down to only the operations that influence the number of points -	LLMemType m1(LLMemType::MTYPE_VOLUME);  	S32 np = 0;  	// Generate an n-sided "circular" path. @@ -475,8 +469,6 @@ S32 LLProfile::getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 of  // filleted and chamfered corners  void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F32 bevel, F32 ang_scale, S32 split)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	// Generate an n-sided "circular" path.  	// 0 is (1,0), and we go counter-clockwise along a circular path from there.  	const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; @@ -730,8 +722,6 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F3  S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split,  						 BOOL is_sculpted, S32 sculpt_size)  { // this is basically LLProfile::generate stripped down to only operations that influence the number of points -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if (detail < MIN_LOD)  	{  		detail = MIN_LOD; @@ -842,8 +832,6 @@ S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 de  BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split,  						 BOOL is_sculpted, S32 sculpt_size)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if ((!mDirty) && (!is_sculpted))  	{  		return FALSE; @@ -1116,8 +1104,6 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai  BOOL LLProfileParams::importFile(LLFILE *fp)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	const S32 BUFSIZE = 16384;  	char buffer[BUFSIZE];	/* Flawfinder: ignore */  	// *NOTE: changing the size or type of these buffers will require @@ -1193,8 +1179,6 @@ BOOL LLProfileParams::exportFile(LLFILE *fp) const  BOOL LLProfileParams::importLegacyStream(std::istream& input_stream)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	const S32 BUFSIZE = 16384;  	char buffer[BUFSIZE];	/* Flawfinder: ignore */  	// *NOTE: changing the size or type of these buffers will require @@ -1286,7 +1270,6 @@ bool LLProfileParams::fromLLSD(LLSD& sd)  void LLProfileParams::copyParams(const LLProfileParams ¶ms)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME);  	setCurveType(params.getCurveType());  	setBegin(params.getBegin());  	setEnd(params.getEnd()); @@ -1503,8 +1486,6 @@ const LLVector2 LLPathParams::getEndScale() const  S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail)  { // this is basically LLPath::generate stripped down to only the operations that influence the number of points -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if (detail < MIN_LOD)  	{  		detail = MIN_LOD; @@ -1554,8 +1535,6 @@ S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail)  BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,  					  BOOL is_sculpted, S32 sculpt_size)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if ((!mDirty) && (!is_sculpted))  	{  		return FALSE; @@ -1683,8 +1662,6 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,  BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split,  							 BOOL is_sculpted, S32 sculpt_size)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	mOpen = TRUE; // Draw end caps  	if (getPathLength() == 0)  	{ @@ -1706,8 +1683,6 @@ BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split,  BOOL LLPathParams::importFile(LLFILE *fp)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	const S32 BUFSIZE = 16384;  	char buffer[BUFSIZE];	/* Flawfinder: ignore */  	// *NOTE: changing the size or type of these buffers will require @@ -1852,8 +1827,6 @@ BOOL LLPathParams::exportFile(LLFILE *fp) const  BOOL LLPathParams::importLegacyStream(std::istream& input_stream)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	const S32 BUFSIZE = 16384;  	char buffer[BUFSIZE];	/* Flawfinder: ignore */  	// *NOTE: changing the size or type of these buffers will require @@ -2061,8 +2034,6 @@ S32 LLVolume::sNumMeshPoints = 0;  LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face, const BOOL is_unique)  	: mParams(params)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	mUnique = is_unique;  	mFaceMask = 0x0;  	mDetail = detail; @@ -2134,7 +2105,6 @@ LLVolume::~LLVolume()  BOOL LLVolume::generate()  { -	LLMemType m1(LLMemType::MTYPE_VOLUME);  	llassert_always(mProfilep);  	//Added 10.03.05 Dave Parks @@ -2730,8 +2700,6 @@ S32	LLVolume::getNumFaces() const  void LLVolume::createVolumeFaces()  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -  	if (mGenerateSingleFace)  	{  		// do nothing @@ -2903,8 +2871,6 @@ F32 LLVolume::sculptGetSurfaceArea()  // create placeholder shape  void LLVolume::sculptGeneratePlaceholder()  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	S32 sizeS = mPathp->mPath.size();  	S32 sizeT = mProfilep->mProfile.size(); @@ -2941,9 +2907,6 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8  	BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;  	BOOL reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror);  // XOR -	 -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	S32 sizeS = mPathp->mPath.size();  	S32 sizeT = mProfilep->mProfile.size(); @@ -3092,7 +3055,6 @@ void sculpt_calc_mesh_resolution(U16 width, U16 height, U8 type, F32 detail, S32  // sculpt replaces generate() for sculpted surfaces  void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME);      U8 sculpt_type = mParams.getSculptType();  	BOOL data_is_empty = FALSE; @@ -3229,7 +3191,6 @@ bool LLVolumeParams::operator<(const LLVolumeParams ¶ms) const  void LLVolumeParams::copyParams(const LLVolumeParams ¶ms)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME);  	mProfileParams.copyParams(params.mProfileParams);  	mPathParams.copyParams(params.mPathParams);  	mSculptID = params.getSculptID(); @@ -3601,8 +3562,6 @@ bool LLVolumeParams::validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 h  S32 *LLVolume::getTriangleIndices(U32 &num_indices) const  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	S32 expected_num_triangle_indices = getNumTriangleIndices();  	if (expected_num_triangle_indices > MAX_VOLUME_TRIANGLE_INDICES)  	{ @@ -4330,8 +4289,6 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,  										  const LLMatrix3& norm_mat_in,  										  S32 face_mask)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -  	LLMatrix4a mat;  	mat.loadu(mat_in); @@ -4793,241 +4750,8 @@ BOOL equalTriangle(const S32 *a, const S32 *b)  	return FALSE;  } -BOOL LLVolume::cleanupTriangleData( const S32 num_input_vertices, -									const std::vector<Point>& input_vertices, -									const S32 num_input_triangles, -									S32 *input_triangles, -									S32 &num_output_vertices, -									LLVector3 **output_vertices, -									S32 &num_output_triangles, -									S32 **output_triangles) -{ -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	 -	/* Testing: avoid any cleanup -	static BOOL skip_cleanup = TRUE; -	if ( skip_cleanup ) -	{ -		num_output_vertices = num_input_vertices; -		num_output_triangles = num_input_triangles; - -		*output_vertices = new LLVector3[num_input_vertices]; -		for (S32 index = 0; index < num_input_vertices; index++) -		{ -			(*output_vertices)[index] = input_vertices[index].mPos; -		} - -		*output_triangles = new S32[num_input_triangles*3]; -		memcpy(*output_triangles, input_triangles, 3*num_input_triangles*sizeof(S32));		// Flawfinder: ignore -		return TRUE; -	} -	*/ - -	// Here's how we do this: -	// Create a structure which contains the original vertex index and the -	// LLVector3 data. -	// "Sort" the data by the vectors -	// Create an array the size of the old vertex list, with a mapping of -	// old indices to new indices. -	// Go through triangles, shift so the lowest index is first -	// Sort triangles by first index -	// Remove duplicate triangles -	// Allocate and pack new triangle data. - -	//LLTimer cleanupTimer; -	//llinfos << "In vertices: " << num_input_vertices << llendl; -	//llinfos << "In triangles: " << num_input_triangles << llendl; - -	S32 i; -	typedef std::multiset<LLVertexIndexPair*, lessVertex> vertex_set_t; -	vertex_set_t vertex_list; - -	LLVertexIndexPair *pairp = NULL; -	for (i = 0; i < num_input_vertices; i++) -	{ -		LLVertexIndexPair *new_pairp = new LLVertexIndexPair(input_vertices[i].mPos, i); -		vertex_list.insert(new_pairp); -	} - -	// Generate the vertex mapping and the list of vertices without -	// duplicates.  This will crash if there are no vertices. -	llassert(num_input_vertices > 0); // check for no vertices! -	S32 *vertex_mapping = new S32[num_input_vertices]; -	LLVector3 *new_vertices = new LLVector3[num_input_vertices]; -	LLVertexIndexPair *prev_pairp = NULL; - -	S32 new_num_vertices; - -	new_num_vertices = 0; -	for (vertex_set_t::iterator iter = vertex_list.begin(), -			 end = vertex_list.end(); -		 iter != end; iter++) -	{ -		pairp = *iter; -		if (!prev_pairp || ((pairp->mVertex - prev_pairp->mVertex).magVecSquared() >= VERTEX_SLOP_SQRD))	 -		{ -			new_vertices[new_num_vertices] = pairp->mVertex; -			//llinfos << "Added vertex " << new_num_vertices << " : " << pairp->mVertex << llendl; -			new_num_vertices++; -			// Update the previous -			prev_pairp = pairp; -		} -		else -		{ -			//llinfos << "Removed duplicate vertex " << pairp->mVertex << ", distance magVecSquared() is " << (pairp->mVertex - prev_pairp->mVertex).magVecSquared() << llendl; -		} -		vertex_mapping[pairp->mIndex] = new_num_vertices - 1; -	} - -	// Iterate through triangles and remove degenerates, re-ordering vertices -	// along the way. -	S32 *new_triangles = new S32[num_input_triangles * 3]; -	S32 new_num_triangles = 0; - -	for (i = 0; i < num_input_triangles; i++) -	{ -		S32 v1 = i*3; -		S32 v2 = v1 + 1; -		S32 v3 = v1 + 2; - -		//llinfos << "Checking triangle " << input_triangles[v1] << ":" << input_triangles[v2] << ":" << input_triangles[v3] << llendl; -		input_triangles[v1] = vertex_mapping[input_triangles[v1]]; -		input_triangles[v2] = vertex_mapping[input_triangles[v2]]; -		input_triangles[v3] = vertex_mapping[input_triangles[v3]]; - -		if ((input_triangles[v1] == input_triangles[v2]) -			|| (input_triangles[v1] == input_triangles[v3]) -			|| (input_triangles[v2] == input_triangles[v3])) -		{ -			//llinfos << "Removing degenerate triangle " << input_triangles[v1] << ":" << input_triangles[v2] << ":" << input_triangles[v3] << llendl; -			// Degenerate triangle, skip -			continue; -		} - -		if (input_triangles[v1] < input_triangles[v2]) -		{ -			if (input_triangles[v1] < input_triangles[v3]) -			{ -				// (0 < 1) && (0 < 2) -				new_triangles[new_num_triangles*3] = input_triangles[v1]; -				new_triangles[new_num_triangles*3+1] = input_triangles[v2]; -				new_triangles[new_num_triangles*3+2] = input_triangles[v3]; -			} -			else -			{ -				// (0 < 1) && (2 < 0) -				new_triangles[new_num_triangles*3] = input_triangles[v3]; -				new_triangles[new_num_triangles*3+1] = input_triangles[v1]; -				new_triangles[new_num_triangles*3+2] = input_triangles[v2]; -			} -		} -		else if (input_triangles[v2] < input_triangles[v3]) -		{ -			// (1 < 0) && (1 < 2) -			new_triangles[new_num_triangles*3] = input_triangles[v2]; -			new_triangles[new_num_triangles*3+1] = input_triangles[v3]; -			new_triangles[new_num_triangles*3+2] = input_triangles[v1]; -		} -		else -		{ -			// (1 < 0) && (2 < 1) -			new_triangles[new_num_triangles*3] = input_triangles[v3]; -			new_triangles[new_num_triangles*3+1] = input_triangles[v1]; -			new_triangles[new_num_triangles*3+2] = input_triangles[v2]; -		} -		new_num_triangles++; -	} - -	if (new_num_triangles == 0) -	{ -		llwarns << "Created volume object with 0 faces." << llendl; -		delete[] new_triangles; -		delete[] vertex_mapping; -		delete[] new_vertices; -		return FALSE; -	} - -	typedef std::set<S32*, lessTriangle> triangle_set_t; -	triangle_set_t triangle_list; - -	for (i = 0; i < new_num_triangles; i++) -	{ -		triangle_list.insert(&new_triangles[i*3]); -	} - -	// Sort through the triangle list, and delete duplicates - -	S32 *prevp = NULL; -	S32 *curp = NULL; - -	S32 *sorted_tris = new S32[new_num_triangles*3]; -	S32 cur_tri = 0; -	for (triangle_set_t::iterator iter = triangle_list.begin(), -			 end = triangle_list.end(); -		 iter != end; iter++) -	{ -		curp = *iter; -		if (!prevp || !equalTriangle(prevp, curp)) -		{ -			//llinfos << "Added triangle " << *curp << ":" << *(curp+1) << ":" << *(curp+2) << llendl; -			sorted_tris[cur_tri*3] = *curp; -			sorted_tris[cur_tri*3+1] = *(curp+1); -			sorted_tris[cur_tri*3+2] = *(curp+2); -			cur_tri++; -			prevp = curp; -		} -		else -		{ -			//llinfos << "Skipped triangle " << *curp << ":" << *(curp+1) << ":" << *(curp+2) << llendl; -		} -	} - -	*output_vertices = new LLVector3[new_num_vertices]; -	num_output_vertices = new_num_vertices; -	for (i = 0; i < new_num_vertices; i++) -	{ -		(*output_vertices)[i] = new_vertices[i]; -	} - -	*output_triangles = new S32[cur_tri*3]; -	num_output_triangles = cur_tri; -	memcpy(*output_triangles, sorted_tris, 3*cur_tri*sizeof(S32));		/* Flawfinder: ignore */ - -	/* -	llinfos << "Out vertices: " << num_output_vertices << llendl; -	llinfos << "Out triangles: " << num_output_triangles << llendl; -	for (i = 0; i < num_output_vertices; i++) -	{ -		llinfos << i << ":" << (*output_vertices)[i] << llendl; -	} -	for (i = 0; i < num_output_triangles; i++) -	{ -		llinfos << i << ":" << (*output_triangles)[i*3] << ":" << (*output_triangles)[i*3+1] << ":" << (*output_triangles)[i*3+2] << llendl; -	} -	*/ - -	//llinfos << "Out vertices: " << num_output_vertices << llendl; -	//llinfos << "Out triangles: " << num_output_triangles << llendl; -	delete[] vertex_mapping; -	vertex_mapping = NULL; -	delete[] new_vertices; -	new_vertices = NULL; -	delete[] new_triangles; -	new_triangles = NULL; -	delete[] sorted_tris; -	sorted_tris = NULL; -	triangle_list.clear(); -	std::for_each(vertex_list.begin(), vertex_list.end(), DeletePointer()); -	vertex_list.clear(); -	 -	return TRUE; -} - -  BOOL LLVolumeParams::importFile(LLFILE *fp)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	//llinfos << "importing volume" << llendl;  	const S32 BUFSIZE = 16384;  	char buffer[BUFSIZE];	/* Flawfinder: ignore */ @@ -5082,8 +4806,6 @@ BOOL LLVolumeParams::exportFile(LLFILE *fp) const  BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	//llinfos << "importing volume" << llendl;  	const S32 BUFSIZE = 16384;  	// *NOTE: changing the size or type of this buffer will require @@ -5123,8 +4845,6 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)  BOOL LLVolumeParams::exportLegacyStream(std::ostream& output_stream) const  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	output_stream <<"\tshape 0\n";  	output_stream <<"\t{\n";  	mPathParams.exportLegacyStream(output_stream); @@ -6340,20 +6060,13 @@ void	LerpPlanarVertex(LLVolumeFace::VertexData& v0,  BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	const std::vector<LLVolume::Point>& mesh = volume->getMesh();  	const std::vector<LLVector3>& profile = volume->getProfile().mProfile;  	S32 max_s = volume->getProfile().getTotal();  	S32 max_t = volume->getPath().mPath.size();  	// S32 i; -	S32 num_vertices = 0, num_indices = 0;  	S32	grid_size = (profile.size()-1)/4; -	S32	quad_count = (grid_size * grid_size); - -	num_vertices = (grid_size+1)*(grid_size+1); -	num_indices = quad_count * 4;  	LLVector4a& min = mExtents[0];  	LLVector4a& max = mExtents[1]; @@ -6492,8 +6205,6 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)  BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if (!(mTypeMask & HOLLOW_MASK) &&   		!(mTypeMask & OPEN_MASK) &&   		((volume->getParams().getPathParams().getBegin()==0.0f)&& @@ -6880,8 +6591,6 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)  void LLVolumeFace::createBinormals()  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	if (!mBinormals)  	{  		allocateBinormals(mNumVertices); @@ -6979,19 +6688,20 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con  {  	S32 new_verts = mNumVertices+1;  	S32 new_size = new_verts*16; -//	S32 old_size = mNumVertices*16; +	S32 old_size = mNumVertices*16;  	//positions -	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size); +	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size, old_size);  	ll_assert_aligned(mPositions,16);  	//normals -	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size); +	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size, old_size);  	ll_assert_aligned(mNormals,16);  	//tex coords  	new_size = ((new_verts*8)+0xF) & ~0xF; -	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size); +	old_size = ((mNumVertices*8)+0xF) & ~0xF; +	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size, old_size);  	ll_assert_aligned(mTexCoords,16); @@ -7045,7 +6755,7 @@ void LLVolumeFace::pushIndex(const U16& idx)  	S32 old_size = ((mNumIndices*2)+0xF) & ~0xF;  	if (new_size != old_size)  	{ -		mIndices = (U16*) ll_aligned_realloc_16(mIndices, new_size); +		mIndices = (U16*) ll_aligned_realloc_16(mIndices, new_size, old_size);  		ll_assert_aligned(mIndices,16);  	} @@ -7087,11 +6797,11 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat  	}  	//allocate new buffer space -	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a)); +	mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a));  	ll_assert_aligned(mPositions, 16); -	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a)); +	mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a));  	ll_assert_aligned(mNormals, 16); -	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF); +	mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF, (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF);  	ll_assert_aligned(mTexCoords, 16);  	mNumVertices = new_count; @@ -7138,7 +6848,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat  	new_count = mNumIndices + face.mNumIndices;  	//allocate new index buffer -	mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF); +	mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF, (mNumIndices*sizeof(U16)+0xF) & ~0xF);  	//get destination address into new index buffer  	U16* dst_idx = mIndices+mNumIndices; @@ -7152,8 +6862,6 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat  BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME); -	  	BOOL flat = mTypeMask & FLAT_MASK;  	U8 sculpt_type = volume->getParams().getSculptType(); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 2e6f9e2f71..c845556557 100644..100755 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1023,17 +1023,6 @@ public:  								   LLVector3* normal = NULL,  								   LLVector3* bi_normal = NULL); -	// The following cleans up vertices and triangles, -	// getting rid of degenerate triangles and duplicate vertices, -	// and allocates new arrays with the clean data. -	static BOOL cleanupTriangleData( const S32 num_input_vertices, -								const std::vector<Point> &input_vertices, -								const S32 num_input_triangles, -								S32 *input_triangles, -								S32 &num_output_vertices, -								LLVector3 **output_vertices, -								S32 &num_output_triangles, -								S32 **output_triangles);  	LLFaceID generateFaceMask();  	BOOL isFaceMaskValid(LLFaceID face_mask); diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index c60b750088..9083273ee5 100644..100755 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -26,7 +26,6 @@  #include "linden_common.h"  #include "llvolumemgr.h" -#include "llmemtype.h"  #include "llvolume.h" @@ -182,7 +181,6 @@ void LLVolumeMgr::insertGroup(LLVolumeLODGroup* volgroup)  // protected  LLVolumeLODGroup* LLVolumeMgr::createNewGroup(const LLVolumeParams& volume_params)  { -	LLMemType m1(LLMemType::MTYPE_VOLUME);  	LLVolumeLODGroup* volgroup = new LLVolumeLODGroup(volume_params);  	insertGroup(volgroup);  	return volgroup; @@ -297,7 +295,6 @@ LLVolume* LLVolumeLODGroup::refLOD(const S32 detail)  	mRefs++;  	if (mVolumeLODs[detail].isNull())  	{ -		LLMemType m1(LLMemType::MTYPE_VOLUME);  		mVolumeLODs[detail] = new LLVolume(mVolumeParams, mDetailScales[detail]);  	}  	mLODRefs[detail]++; diff --git a/indra/llmath/llvolumemgr.h b/indra/llmath/llvolumemgr.h index c75906f675..c75906f675 100644..100755 --- a/indra/llmath/llvolumemgr.h +++ b/indra/llmath/llvolumemgr.h diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index cc83cb7235..cc83cb7235 100644..100755 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 9ae34a0c4e..9ae34a0c4e 100644..100755 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h diff --git a/indra/llmath/m3math.cpp b/indra/llmath/m3math.cpp index 802ddb9e57..802ddb9e57 100644..100755 --- a/indra/llmath/m3math.cpp +++ b/indra/llmath/m3math.cpp diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index 2be5452f8d..2be5452f8d 100644..100755 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 6a1b4143cf..6a1b4143cf 100644..100755 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index a7dce10397..a7dce10397 100644..100755 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h diff --git a/indra/llmath/raytrace.cpp b/indra/llmath/raytrace.cpp index f38fe49bcb..f38fe49bcb 100644..100755 --- a/indra/llmath/raytrace.cpp +++ b/indra/llmath/raytrace.cpp diff --git a/indra/llmath/raytrace.h b/indra/llmath/raytrace.h index 2d32af0c86..2d32af0c86 100644..100755 --- a/indra/llmath/raytrace.h +++ b/indra/llmath/raytrace.h diff --git a/indra/llmath/tests/alignment_test.cpp b/indra/llmath/tests/alignment_test.cpp index ac0c45ae6f..5ee3c45502 100644..100755 --- 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); @@ -68,7 +79,7 @@ template<> template<>  void alignment_test_object_t::test<1>()  {  #   ifdef LL_DEBUG -	skip("This test fails on Windows when compiled in debug mode."); +//	skip("This test fails on Windows when compiled in debug mode.");  #   endif  	const int num_tests = 7; @@ -78,7 +89,7 @@ void alignment_test_object_t::test<1>()  		align_ptr = ll_aligned_malloc_16(sizeof(MyVector4a));  		ensure("ll_aligned_malloc_16 failed", is_aligned(align_ptr,16)); -		align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a)); +		align_ptr = ll_aligned_realloc_16(align_ptr,2*sizeof(MyVector4a), sizeof(MyVector4a));  		ensure("ll_aligned_realloc_16 failed", is_aligned(align_ptr,16));  		ll_aligned_free_16(align_ptr); @@ -105,7 +116,7 @@ template<> template<>  void alignment_test_object_t::test<3>()  {  #   ifdef LL_DEBUG -	skip("This test fails on Windows when compiled in debug mode."); +//	skip("This test fails on Windows when compiled in debug mode.");  #   endif  	const int ARR_SIZE = 7; @@ -117,12 +128,14 @@ void alignment_test_object_t::test<3>()  	}  	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;   }  } diff --git a/indra/llmath/tests/llbbox_test.cpp b/indra/llmath/tests/llbbox_test.cpp index fd0dbb58fc..fd0dbb58fc 100644..100755 --- a/indra/llmath/tests/llbbox_test.cpp +++ b/indra/llmath/tests/llbbox_test.cpp diff --git a/indra/llmath/tests/llbboxlocal_test.cpp b/indra/llmath/tests/llbboxlocal_test.cpp index f31e4126c4..f31e4126c4 100644..100755 --- a/indra/llmath/tests/llbboxlocal_test.cpp +++ b/indra/llmath/tests/llbboxlocal_test.cpp diff --git a/indra/llmath/tests/llmodularmath_test.cpp b/indra/llmath/tests/llmodularmath_test.cpp index 063d3ef79f..063d3ef79f 100644..100755 --- a/indra/llmath/tests/llmodularmath_test.cpp +++ b/indra/llmath/tests/llmodularmath_test.cpp diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index e69010b2d6..e69010b2d6 100644..100755 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp diff --git a/indra/llmath/tests/llrect_test.cpp b/indra/llmath/tests/llrect_test.cpp index d740173e69..d740173e69 100644..100755 --- a/indra/llmath/tests/llrect_test.cpp +++ b/indra/llmath/tests/llrect_test.cpp diff --git a/indra/llmath/tests/m3math_test.cpp b/indra/llmath/tests/m3math_test.cpp index 1ca2b005d9..1ca2b005d9 100644..100755 --- a/indra/llmath/tests/m3math_test.cpp +++ b/indra/llmath/tests/m3math_test.cpp diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp index 91a2e6c009..91a2e6c009 100644..100755 --- a/indra/llmath/tests/mathmisc_test.cpp +++ b/indra/llmath/tests/mathmisc_test.cpp diff --git a/indra/llmath/tests/v2math_test.cpp b/indra/llmath/tests/v2math_test.cpp index 4d6a2eca93..4d6a2eca93 100644..100755 --- a/indra/llmath/tests/v2math_test.cpp +++ b/indra/llmath/tests/v2math_test.cpp diff --git a/indra/llmath/tests/v3color_test.cpp b/indra/llmath/tests/v3color_test.cpp index 29d1c483ab..29d1c483ab 100644..100755 --- a/indra/llmath/tests/v3color_test.cpp +++ b/indra/llmath/tests/v3color_test.cpp diff --git a/indra/llmath/tests/v3dmath_test.cpp b/indra/llmath/tests/v3dmath_test.cpp index 20b26faa12..20b26faa12 100644..100755 --- a/indra/llmath/tests/v3dmath_test.cpp +++ b/indra/llmath/tests/v3dmath_test.cpp diff --git a/indra/llmath/tests/v3math_test.cpp b/indra/llmath/tests/v3math_test.cpp index e4ae1c10ef..e4ae1c10ef 100644..100755 --- a/indra/llmath/tests/v3math_test.cpp +++ b/indra/llmath/tests/v3math_test.cpp diff --git a/indra/llmath/tests/v4color_test.cpp b/indra/llmath/tests/v4color_test.cpp index d7eec3c87f..d7eec3c87f 100644..100755 --- a/indra/llmath/tests/v4color_test.cpp +++ b/indra/llmath/tests/v4color_test.cpp diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp index 128f6f3564..128f6f3564 100644..100755 --- a/indra/llmath/tests/v4coloru_test.cpp +++ b/indra/llmath/tests/v4coloru_test.cpp diff --git a/indra/llmath/tests/v4math_test.cpp b/indra/llmath/tests/v4math_test.cpp index 191ac864df..191ac864df 100644..100755 --- a/indra/llmath/tests/v4math_test.cpp +++ b/indra/llmath/tests/v4math_test.cpp diff --git a/indra/llmath/tests/xform_test.cpp b/indra/llmath/tests/xform_test.cpp index 49870eef3c..49870eef3c 100644..100755 --- a/indra/llmath/tests/xform_test.cpp +++ b/indra/llmath/tests/xform_test.cpp diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index a0cd642853..a0cd642853 100644..100755 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index 8d5db96f5e..8d5db96f5e 100644..100755 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp index d38f48b11e..d38f48b11e 100644..100755 --- a/indra/llmath/v3color.cpp +++ b/indra/llmath/v3color.cpp diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 56cb2ae73e..daf3a6857b 100644..100755 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -33,6 +33,7 @@ class LLVector4;  #include "llerror.h"  #include "llmath.h"  #include "llsd.h" +#include <string.h>  //  LLColor3 = |r g b| diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp index a50cb3c6ca..a50cb3c6ca 100644..100755 --- a/indra/llmath/v3dmath.cpp +++ b/indra/llmath/v3dmath.cpp diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index 578dcdc8ea..578dcdc8ea 100644..100755 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index e7107dee16..e7107dee16 100644..100755 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 0432aeba4c..0432aeba4c 100644..100755 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 81ac62be56..81ac62be56 100644..100755 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index b047f86e6e..b047f86e6e 100644..100755 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp index f1a2518cf3..f1a2518cf3 100644..100755 --- a/indra/llmath/v4coloru.cpp +++ b/indra/llmath/v4coloru.cpp diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 12da7e2dd7..12da7e2dd7 100644..100755 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h diff --git a/indra/llmath/v4math.cpp b/indra/llmath/v4math.cpp index 2782cf2966..2782cf2966 100644..100755 --- a/indra/llmath/v4math.cpp +++ b/indra/llmath/v4math.cpp diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 623c8b2003..623c8b2003 100644..100755 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h diff --git a/indra/llmath/xform.cpp b/indra/llmath/xform.cpp index b75aec6a27..b75aec6a27 100644..100755 --- a/indra/llmath/xform.cpp +++ b/indra/llmath/xform.cpp diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index 1b50749b3e..1b50749b3e 100644..100755 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h | 
