From dc60a7564abf16cbf269e47cfc33ed00c6bb0870 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 24 Oct 2013 14:37:57 -0700 Subject: SH-4577 WIP Interesting: viewer crashed when clicking a offline Conversation containing a shared object potential fix by making instance tracker allow key collisions for LLToastNotifyPanel changed assertion macro to use original unpreprocessed source code renamed instance tracker behavior macros to use LL prefix added RestoreCameraPosOnLogin setting to optionally restore old camera positioning behavior --- indra/llcommon/llerror.h | 8 +++++--- indra/llcommon/llinstancetracker.h | 8 ++++---- indra/llcommon/llthreadlocalstorage.h | 2 +- indra/llcommon/lltrace.h | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 046cd69543..5268cf9a4d 100755 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -72,11 +72,13 @@ const int LL_ERR_NOERR = 0; #endif // !_DEBUG -#define llassert_always(func) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << #func << ")" << LL_ENDL; +#define llassert_always_msg(func, msg) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")" << LL_ENDL + +#define llassert_always(func) llassert_always_msg(func, #func) #ifdef SHOW_ASSERT -#define llassert(func) llassert_always(func) -#define llverify(func) llassert_always(func) +#define llassert(func) llassert_always_msg(func, #func) +#define llverify(func) llassert_always_msg(func, #func) #else #define llassert(func) #define llverify(func) do {if (func) {}} while(0) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 3fdb84cfd7..3107415ccf 100755 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -64,8 +64,8 @@ LL_COMMON_API void assert_main_thread(); enum EInstanceTrackerAllowKeyCollisions { - InstanceTrackerAllowKeyCollisions, - InstanceTrackerDisallowKeyCollisions + LLInstanceTrackerAllowKeyCollisions, + LLInstanceTrackerDisallowKeyCollisions }; /// This mix-in class adds support for tracking all instances of the specified class parameter T @@ -73,7 +73,7 @@ enum EInstanceTrackerAllowKeyCollisions /// If KEY is not provided, then instances are stored in a simple set /// @NOTE: see explicit specialization below for default KEY==void case /// @NOTE: this class is not thread-safe unless used as read-only -template +template class LLInstanceTracker : public LLInstanceTrackerBase { typedef LLInstanceTracker self_t; @@ -216,7 +216,7 @@ private: mInstanceKey = key; InstanceMap& map = getMap_(); typename InstanceMap::iterator insertion_point_it = map.lower_bound(key); - if (ALLOW_KEY_COLLISIONS == InstanceTrackerDisallowKeyCollisions + if (ALLOW_KEY_COLLISIONS == LLInstanceTrackerDisallowKeyCollisions && insertion_point_it != map.end() && insertion_point_it->first == key) { diff --git a/indra/llcommon/llthreadlocalstorage.h b/indra/llcommon/llthreadlocalstorage.h index 177e822227..ec3b52c8cb 100644 --- a/indra/llcommon/llthreadlocalstorage.h +++ b/indra/llcommon/llthreadlocalstorage.h @@ -43,7 +43,7 @@ public: } LLThreadLocalPointerBase( const LLThreadLocalPointerBase& other) - : mThreadKey(NULL) + : mThreadKey(NULL) { if (sInitialized) { diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index b499036af2..8b67dd8f44 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -69,10 +69,10 @@ protected: template class StatType : public StatBase, - public LLInstanceTracker, std::string, InstanceTrackerAllowKeyCollisions> + public LLInstanceTracker, std::string, LLInstanceTrackerAllowKeyCollisions> { public: - typedef LLInstanceTracker, std::string, InstanceTrackerAllowKeyCollisions> instance_tracker_t; + typedef LLInstanceTracker, std::string, LLInstanceTrackerAllowKeyCollisions> instance_tracker_t; StatType(const char* name, const char* description) : instance_tracker_t(name), StatBase(name, description), -- cgit v1.2.3