summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2011-05-12 16:09:42 -0700
committerbrad kittenbrink <brad@lindenlab.com>2011-05-12 16:09:42 -0700
commit2a843e9a6bb5cb70f69794419ab4a7d16ee3c6cb (patch)
treeb9ab49342513f0f3fc80c58df7657c92f67f1bc2 /indra/llmath
parentb3dddbf30b42eff8ef7031c63e91244f07e8bd77 (diff)
Fix up alignment problems for debug build.
reviewed by davep.
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 70e1e1f312..b3446b72b8 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -1883,9 +1883,9 @@ LLVolume::~LLVolume()
mProfilep = NULL;
mVolumeFaces.clear();
- free(mHullPoints);
+ ll_aligned_free_16(mHullPoints);
mHullPoints = NULL;
- free(mHullIndices);
+ ll_aligned_free_16(mHullIndices);
mHullIndices = NULL;
}
@@ -2007,7 +2007,7 @@ void LLVolumeFace::VertexData::init()
{
if (!mData)
{
- mData = (LLVector4a*) malloc(sizeof(LLVector4a)*2);
+ mData = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*2);
}
}
@@ -2036,7 +2036,7 @@ const LLVolumeFace::VertexData& LLVolumeFace::VertexData::operator=(const LLVolu
LLVolumeFace::VertexData::~VertexData()
{
- free(mData);
+ ll_aligned_free_16(mData);
mData = NULL;
}
@@ -5192,7 +5192,7 @@ LLVolumeFace::LLVolumeFace() :
mWeights(NULL),
mOctree(NULL)
{
- mExtents = (LLVector4a*) malloc(sizeof(LLVector4a)*3);
+ mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3);
mCenter = mExtents+2;
}
@@ -5213,7 +5213,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src)
mWeights(NULL),
mOctree(NULL)
{
- mExtents = (LLVector4a*) malloc(sizeof(LLVector4a)*3);
+ mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3);
mCenter = mExtents+2;
*this = src;
}
@@ -5263,7 +5263,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src)
}
else
{
- free(mBinormals);
+ ll_aligned_free_16(mBinormals);
mBinormals = NULL;
}
@@ -5274,7 +5274,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src)
}
else
{
- free(mWeights);
+ ll_aligned_free_16(mWeights);
mWeights = NULL;
}
}
@@ -5292,7 +5292,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src)
LLVolumeFace::~LLVolumeFace()
{
- free(mExtents);
+ ll_aligned_free_16(mExtents);
mExtents = NULL;
freeData();
@@ -5300,17 +5300,17 @@ LLVolumeFace::~LLVolumeFace()
void LLVolumeFace::freeData()
{
- free(mPositions);
+ ll_aligned_free_16(mPositions);
mPositions = NULL;
- free( mNormals);
+ ll_aligned_free_16( mNormals);
mNormals = NULL;
- free(mTexCoords);
+ ll_aligned_free_16(mTexCoords);
mTexCoords = NULL;
- free(mIndices);
+ ll_aligned_free_16(mIndices);
mIndices = NULL;
- free(mBinormals);
+ ll_aligned_free_16(mBinormals);
mBinormals = NULL;
- free(mWeights);
+ ll_aligned_free_16(mWeights);
mWeights = NULL;
delete mOctree;
@@ -5827,21 +5827,21 @@ void LLVolumeFace::cacheOptimize()
//allocate space for new buffer
S32 num_verts = mNumVertices;
- LLVector4a* pos = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
- LLVector4a* norm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ LLVector4a* pos = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
+ LLVector4a* norm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
- LLVector2* tc = (LLVector2*) malloc(size);
+ LLVector2* tc = (LLVector2*) ll_aligned_malloc_16(size);
LLVector4a* wght = NULL;
if (mWeights)
{
- wght = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ wght = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
}
LLVector4a* binorm = NULL;
if (mBinormals)
{
- binorm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
}
//allocate mapping of old indices to new indices
@@ -5878,11 +5878,11 @@ void LLVolumeFace::cacheOptimize()
mIndices[i] = new_idx[mIndices[i]];
}
- free(mPositions);
- free(mNormals);
- free(mTexCoords);
- free(mWeights);
- free(mBinormals);
+ ll_aligned_free_16(mPositions);
+ ll_aligned_free_16(mNormals);
+ ll_aligned_free_16(mTexCoords);
+ ll_aligned_free_16(mWeights);
+ ll_aligned_free_16(mBinormals);
mPositions = pos;
mNormals = norm;
@@ -6603,23 +6603,23 @@ void LLVolumeFace::createBinormals()
void LLVolumeFace::resizeVertices(S32 num_verts)
{
- free(mPositions);
- free(mNormals);
- free(mBinormals);
- free(mTexCoords);
+ ll_aligned_free_16(mPositions);
+ ll_aligned_free_16(mNormals);
+ ll_aligned_free_16(mBinormals);
+ ll_aligned_free_16(mTexCoords);
mBinormals = NULL;
if (num_verts)
{
- mPositions = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ mPositions = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
assert_aligned(mPositions, 16);
- mNormals = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ mNormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
assert_aligned(mNormals, 16);
//pad texture coordinate block end to allow for QWORD reads
S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
- mTexCoords = (LLVector2*) malloc(size);
+ mTexCoords = (LLVector2*) ll_aligned_malloc_16(size);
assert_aligned(mTexCoords, 16);
}
else
@@ -6655,7 +6655,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
//just clear binormals
- free(mBinormals);
+ ll_aligned_free_16(mBinormals);
mBinormals = NULL;
mPositions[mNumVertices] = pos;
@@ -6667,26 +6667,26 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
void LLVolumeFace::allocateBinormals(S32 num_verts)
{
- free(mBinormals);
- mBinormals = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ ll_aligned_free_16(mBinormals);
+ mBinormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
}
void LLVolumeFace::allocateWeights(S32 num_verts)
{
- free(mWeights);
- mWeights = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts);
+ ll_aligned_free_16(mWeights);
+ mWeights = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
}
void LLVolumeFace::resizeIndices(S32 num_indices)
{
- free(mIndices);
+ ll_aligned_free_16(mIndices);
if (num_indices)
{
//pad index block end to allow for QWORD reads
S32 size = ((num_indices*sizeof(U16)) + 0xF) & ~0xF;
- mIndices = (U16*) malloc(size);
+ mIndices = (U16*) ll_aligned_malloc_16(size);
}
else
{