summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.cpp
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.cpp
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.cpp')
-rwxr-xr-xindra/llcommon/llfasttimer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index 23e27622bf..7a7f1c79c1 100755
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -247,17 +247,18 @@ void TimeBlock::incrementalUpdateTimerTree()
void TimeBlock::updateTimes()
- {
- U64 cur_time = getCPUClockCount64();
-
+{
// walk up stack of active timers and accumulate current time while leaving timing structures active
- BlockTimerStackRecord* stack_record = ThreadTimerStack::getInstance();
+ BlockTimerStackRecord* stack_record = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (stack_record) return;
+
+ U64 cur_time = getCPUClockCount64();
BlockTimer* cur_timer = stack_record->mActiveTimer;
TimeBlockAccumulator* accumulator = stack_record->mTimeBlock->getPrimaryAccumulator();
while(cur_timer
&& cur_timer->mParentTimerData.mActiveTimer != cur_timer) // root defined by parent pointing to self
- {
+ {
U64 cumulative_time_delta = cur_time - cur_timer->mStartTime;
accumulator->mTotalTimeCounter += cumulative_time_delta
- (accumulator->mTotalTimeCounter