From 93eaccae6fe6e8442a3c6e5a2d40a408aa44df77 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Thu, 28 Feb 2013 15:35:14 -0800 Subject: Modify LLInstanceTracker to avoid using a map of strings to find a map of foo to find some pointers --- indra/llcommon/llinstancetracker.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 5dc3ea5d7b..0804be358f 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,18 +32,14 @@ // external library headers // other Linden headers -//static -void * & LLInstanceTrackerBase::getInstances(std::type_info const & info) -{ - typedef std::map InstancesMap; - static InstancesMap instances; +static void* sInstanceTrackerData[ kInstanceTrackTypeCount ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) +{ // std::map::insert() is just what we want here. You attempt to insert a // (key, value) pair. If the specified key doesn't yet exist, it inserts // the pair and returns a std::pair of (iterator, true). If the specified // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. - return instances.insert(InstancesMap::value_type(info.name(), - InstancesMap::mapped_type())) - .first->second; -} + return sInstanceTrackerData[t]; +} \ No newline at end of file -- cgit v1.2.3 From 1b3dec4c11e76f5c5ab6ab8bd2464d07177009c4 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Thu, 7 Mar 2013 09:00:26 -0800 Subject: Put newline at end of file to appease gcc's OCD --- indra/llcommon/llinstancetracker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 0804be358f..65ef4322f6 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -42,4 +42,5 @@ void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. return sInstanceTrackerData[t]; -} \ No newline at end of file +} + -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/llcommon/llinstancetracker.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/llcommon/llinstancetracker.cpp (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From 205938b652bc9218494835afadce095b29f1d19d Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 16:27:13 -0700 Subject: Fix crash introduced by LLInstanceTrackerBase optimization. Reviewed by Kelly --- indra/llcommon/llinstancetracker.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 65ef4322f6..89430f82d7 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,7 +32,9 @@ // external library headers // other Linden headers -static void* sInstanceTrackerData[ kInstanceTrackTypeCount ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static bool sInstanceTrackerData_initialized = false; +static void* sInstanceTrackerData[ kInstanceTrackTypeCount ]; + void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) { @@ -41,6 +43,15 @@ void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) // the pair and returns a std::pair of (iterator, true). If the specified // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. + if (!sInstanceTrackerData_initialized) + { + for (S32 i = 0; i < (S32) kInstanceTrackTypeCount; i++) + { + sInstanceTrackerData[i] = NULL; + } + sInstanceTrackerData_initialized = true; + } + return sInstanceTrackerData[t]; } -- cgit v1.2.3 From 87ba85eaabbfd5fd7ad8ca8136f4783b1d932264 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 09:35:38 -0700 Subject: =?UTF-8?q?=C3=AF=C2=BB=C2=BFdiff=20-r=2059c7bed66dfd=20indra/llco?= =?UTF-8?q?mmon/lleventapi.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llcommon/llinstancetracker.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 89430f82d7..247d0dc4fb 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,26 +32,4 @@ // external library headers // other Linden headers -static bool sInstanceTrackerData_initialized = false; -static void* sInstanceTrackerData[ kInstanceTrackTypeCount ]; - - -void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) -{ - // std::map::insert() is just what we want here. You attempt to insert a - // (key, value) pair. If the specified key doesn't yet exist, it inserts - // the pair and returns a std::pair of (iterator, true). If the specified - // key DOES exist, insert() simply returns (iterator, false). One lookup - // handles both cases. - if (!sInstanceTrackerData_initialized) - { - for (S32 i = 0; i < (S32) kInstanceTrackTypeCount; i++) - { - sInstanceTrackerData[i] = NULL; - } - sInstanceTrackerData_initialized = true; - } - - return sInstanceTrackerData[t]; -} -- cgit v1.2.3 From faf844ff996f205af6eb6b2ebd5290594da8d142 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 10:59:25 -0700 Subject: Trivial change to note that earlier changeset 27742 (1c3262183eb5) is a re-work of the LLInstanceTracker code done by Richard. The commit comment is cryptic --- indra/llcommon/llinstancetracker.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 247d0dc4fb..64a313b5ff 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,4 +32,3 @@ // external library headers // other Linden headers - -- cgit v1.2.3