diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-07 22:18:15 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-07 22:18:15 +0100 |
commit | 430f9420cf0094635b0b0428a29ff7dfaf5718e8 (patch) | |
tree | 193a6f22541ce4dbe8199fcde5bd5d1f006a09b1 /indra/llmath/llrigginginfo.h | |
parent | 2a2046fd074ffd8df8503e4a7197fd74e006f296 (diff) |
SL-915 - more on dynamic extent tracking, possible fix for 32-bit crash issues
Diffstat (limited to 'indra/llmath/llrigginginfo.h')
-rw-r--r-- | indra/llmath/llrigginginfo.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/llmath/llrigginginfo.h b/indra/llmath/llrigginginfo.h index 7b36880a39..b09746a5b7 100644 --- a/indra/llmath/llrigginginfo.h +++ b/indra/llmath/llrigginginfo.h @@ -44,6 +44,17 @@ public: LLVector4a *getRiggedExtents(); const LLVector4a *getRiggedExtents() const; void merge(const LLJointRiggingInfo& other); + + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + private: LL_ALIGN_16(LLVector4a mRiggedExtents[2]); bool mIsRiggedTo; @@ -51,8 +62,25 @@ private: // For storing all the rigging info associated with a given avatar or // object, keyed by joint_num. -typedef std::vector<LLJointRiggingInfo> joint_rig_info_tab; +// Using direct memory management instead of std::vector<> to avoid alignment issues. +class LLJointRiggingInfoTab +{ +public: + LLJointRiggingInfoTab(); + ~LLJointRiggingInfoTab(); + void resize(S32 size); + void clear(); + S32 size() const { return mSize; } + void merge(const LLJointRiggingInfoTab& src); + LLJointRiggingInfo& operator[](S32 i) { return mRigInfoPtr[i]; } + const LLJointRiggingInfo& operator[](S32 i) const { return mRigInfoPtr[i]; }; +private: + // Not implemented + LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src); + LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src); -void mergeRigInfoTab(joint_rig_info_tab& dst, const joint_rig_info_tab& src); + LLJointRiggingInfo *mRigInfoPtr; + S32 mSize; +}; #endif |