summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-06-30 13:32:34 -0700
committerRichard Linden <none@none>2013-06-30 13:32:34 -0700
commit2fc422f39ddaca25c69e8cf2092a9d66840379f3 (patch)
tree61587ceb0f5a3298769bcce9ca29116fa0e793db /indra/llcommon/llfasttimer.h
parentffa7123bb5187e1da491a8f475d696053d9c9ee4 (diff)
fixed memory leak due to implementation of LLThreadLocalSingleton
removed LLThreadLocalSingleton collapsed all thread recorder classes to single type, LLTrace::ThreadRecorder moved fasttimer stack head to llthreadlocalsingletonpointer via ThreadRecorder
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rwxr-xr-xindra/llcommon/llfasttimer.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index ab8612a8ad..73c40749ed 100755
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -38,22 +38,6 @@ class LLMutex;
namespace LLTrace
{
-class ThreadTimerStack
-: public BlockTimerStackRecord,
- public LLThreadLocalSingleton<ThreadTimerStack>
-{
- friend class LLThreadLocalSingleton<ThreadTimerStack>;
- ThreadTimerStack()
- {}
-
-public:
- ThreadTimerStack& operator=(const BlockTimerStackRecord& other)
- {
- BlockTimerStackRecord::operator=(other);
- return *this;
- }
-};
-
class BlockTimer
{
public:
@@ -271,7 +255,8 @@ public:
LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer)
{
#if FAST_TIMER_ON
- BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists();
+ BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (!cur_timer_data) return;
TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator();
accumulator->mActiveCount++;
mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter;
@@ -293,7 +278,9 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer()
{
#if FAST_TIMER_ON
U64 total_time = TimeBlock::getCPUClockCount64() - mStartTime;
- BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists();
+ BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (!cur_timer_data) return;
+
TimeBlockAccumulator* accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator();
accumulator->mCalls++;