Explicit enforcement of alignment for all aligned types, including structures with aligned members. (Compiler handholding)

This commit is contained in:
Shyotl
2014-06-22 03:39:33 -05:00
parent 061178ad82
commit 7c073c1db7
18 changed files with 140 additions and 32 deletions

View File

@@ -239,7 +239,7 @@ public:
static U32 getRiggedDataMask(U32 type);
public: //aligned members
LLVector4a mExtents[2];
LL_ALIGN_16(LLVector4a mExtents[2]);
private:
F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius );

View File

@@ -40,13 +40,24 @@
class LLVOAvatar;
class LLViewerJointMesh;
LL_ALIGN_PREFIX(16)
class LLPreviewAnimation : public LLViewerDynamicTexture
{
public:
virtual ~LLPreviewAnimation();
public:
LLPreviewAnimation(S32 width, S32 height);
LLPreviewAnimation(S32 width, S32 height);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
/*virtual*/ S8 getType() const ;
@@ -69,7 +80,7 @@ protected:
LLVector3 mCameraOffset;
LLVector3 mCameraRelPos;
LLPointer<LLVOAvatar> mDummyAvatar;
};
} LL_ALIGN_POSTFIX(16);
class LLFloaterBvhPreview : public LLFloaterNameDesc
{

View File

@@ -49,7 +49,7 @@ private:
protected:
void draw();
LLPreviewAnimation mAnimPreview;
LL_ALIGN_16(LLPreviewAnimation mAnimPreview);
LLRect mPreviewRect;
S32 mLastMouseX;
S32 mLastMouseY;

View File

@@ -52,6 +52,16 @@ protected:
public:
LLImagePreviewSculpted(S32 width, S32 height);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
/*virtual*/ S8 getType() const ;
void setPreviewTarget(LLImageRaw *imagep, F32 distance);
@@ -85,6 +95,16 @@ protected:
public:
LLImagePreviewAvatar(S32 width, S32 height);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
/*virtual*/ S8 getType() const ;
void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male);

View File

@@ -302,6 +302,16 @@ public:
LLModelPreview(S32 width, S32 height, LLFloater* fmp);
virtual ~LLModelPreview();
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
void resetPreviewTarget();
void setPreviewTarget(F32 distance);
void setTexture(U32 name) { mTextureName = name; }

View File

@@ -3576,6 +3576,7 @@ void renderLights(LLDrawable* drawablep)
}
}
LL_ALIGN_PREFIX(16)
class LLRenderOctreeRaycast : public LLOctreeTriangleRayIntersect
{
public:
@@ -3648,7 +3649,7 @@ public:
}
}
}
};
} LL_ALIGN_POSTFIX(16);
void renderRaycast(LLDrawable* drawablep)
{

View File

@@ -102,7 +102,7 @@ public:
void validate();
LLVector4a mExtents[2];
LL_ALIGN_16(LLVector4a mExtents[2]);
LLPointer<LLVertexBuffer> mVertexBuffer;
LLPointer<LLViewerTexture> mTexture;

View File

@@ -65,6 +65,16 @@ public:
LLWearable *wearable,
F32 param_weight);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
/*virtual*/ S8 getType() const ;
BOOL needsRender();
@@ -110,6 +120,17 @@ protected:
/*virtual */ ~LLVisualParamReset(){}
public:
LLVisualParamReset();
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
/*virtual */ BOOL render();
/*virtual*/ S8 getType() const ;

View File

@@ -79,6 +79,16 @@ public:
LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height);
virtual ~LLViewerTexLayerSetBuffer();
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
public:
/*virtual*/ S8 getType() const;
BOOL isInitialized(void) const;