diff options
| author | Richard Linden <none@none> | 2013-05-20 19:27:50 -0700 |
|---|---|---|
| committer | Richard Linden <none@none> | 2013-05-20 19:27:50 -0700 |
| commit | ab5106535758393e02b075d1e404e4e1fcf81abf (patch) | |
| tree | 04d24cb4bfbc57f75604e44dec23242e4df8a537 /indra/llcommon/llpointer.h | |
| parent | fbce0030494ccb6fa8f6cf45e1ec95a2fa922bcd (diff) | |
SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
removed extra dereference for copy on write pointer
moved copyonwrite mechanism to RecordingBuffers from individual buffer
fixed logic that was leaving scene unfrozen when camera moved during metrics gathering
Diffstat (limited to 'indra/llcommon/llpointer.h')
| -rw-r--r-- | indra/llcommon/llpointer.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index f03551045e..b9a9bf1ef0 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -166,7 +166,7 @@ protected: }; template<typename Type> -class LLCopyOnWritePointer +class LLCopyOnWritePointer : public LLPointer<Type> { public: typedef LLCopyOnWritePointer<Type> self_t; @@ -175,43 +175,40 @@ public: {} LLCopyOnWritePointer(Type* ptr) - : mPointer(ptr) + : LLPointer(ptr) {} LLCopyOnWritePointer(LLPointer<Type>& ptr) - : mPointer(ptr) + : LLPointer(ptr) {} Type* write() { makeUnique(); - return mPointer.get(); + return mPointer; } void makeUnique() { - if (mPointer.notNull() && mPointer.get()->getNumRefs() > 1) + if (notNull() && mPointer->getNumRefs() > 1) { - mPointer = new Type(*mPointer.get()); + *(LLPointer*)(this) = new Type(*mPointer); } } + /*operator BOOL() const { return (mPointer != NULL); } + operator bool() const { return (mPointer != NULL); } + bool operator!() const { return (mPointer == NULL); } + bool isNull() const { return (mPointer == NULL); } + bool notNull() const { return (mPointer != NULL); } - operator BOOL() const { return (BOOL)mPointer; } - operator bool() const { return (bool)mPointer; } - bool operator!() const { return !mPointer; } - bool isNull() const { return mPointer.isNull(); } - bool notNull() const { return mPointer.notNull(); } - - bool operator !=(Type* ptr) const { return (mPointer.get() != ptr); } - bool operator ==(Type* ptr) const { return (mPointer.get() == ptr); } + bool operator !=(Type* ptr) const { return (mPointer != ptr); } + bool operator ==(Type* ptr) const { return (mPointer == ptr); } bool operator ==(const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer == ptr.mPointer); } bool operator < (const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer < ptr.mPointer); } bool operator > (const LLCopyOnWritePointer<Type>& ptr) const { return (mPointer > ptr.mPointer); } - operator const Type*() const { return mPointer.get(); } - const Type* operator->() const { return mPointer.get(); } -protected: - LLPointer<Type> mPointer; + operator const Type*() const { return mPointer; } + const Type* operator->() const { return mPointer; }*/ }; #endif |
