From f81c5a4e94a26689cd3cfa8078bb9cde360541a0 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 11 Dec 2014 16:32:13 -0800
Subject: [PATCH] Add bespoke ctor/dtor that align on 16byte boundaries when
 creating things on the heap

---
 indra/llappearance/llpolymorph.h              | 10 ++++++++++
 indra/llappearance/llpolyskeletaldistortion.h | 13 +++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h
index 7e712f9e947..3c2c68079c3 100644
--- a/indra/llappearance/llpolymorph.h
+++ b/indra/llappearance/llpolymorph.h
@@ -182,6 +182,16 @@ class LLPolyMorphTarget : public LLViewerVisualParam
 	void	applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
 	void	addPendingMorphMask() { mNumMorphMasksPending++; }
 
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
 protected:
 	LLPolyMorphTarget(const LLPolyMorphTarget& pOther);
 
diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h
index ea2adb8a87c..ab1a132d190 100644
--- a/indra/llappearance/llpolyskeletaldistortion.h
+++ b/indra/llappearance/llpolyskeletaldistortion.h
@@ -73,6 +73,19 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
 	
 	/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
 
+
+
+	void* operator new(size_t size)
+	{
+		return ll_aligned_malloc_16(size);
+	}
+
+	void operator delete(void* ptr)
+	{
+		ll_aligned_free_16(ptr);
+	}
+
+
 protected:
 	typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
 	bone_info_list_t mBoneInfoList;
-- 
GitLab