summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lltraceaccumulators.cpp17
-rw-r--r--indra/llcommon/lltracethreadrecorder.cpp17
2 files changed, 22 insertions, 12 deletions
diff --git a/indra/llcommon/lltraceaccumulators.cpp b/indra/llcommon/lltraceaccumulators.cpp
index 9f270e60b9..6381281a56 100644
--- a/indra/llcommon/lltraceaccumulators.cpp
+++ b/indra/llcommon/lltraceaccumulators.cpp
@@ -41,20 +41,29 @@ extern MemStatHandle gTraceMemStat;
AccumulatorBufferGroup::AccumulatorBufferGroup()
{
- /*claim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ claim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
- claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator));*/
+ claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator));
+}
+
+AccumulatorBufferGroup::AccumulatorBufferGroup(const AccumulatorBufferGroup&)
+{
+ claim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
+ claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
+ claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
+ claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator));
}
AccumulatorBufferGroup::~AccumulatorBufferGroup()
{
- /*disclaim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ disclaim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
disclaim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
disclaim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
disclaim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
- disclaim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator));*/
+ disclaim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator));
}
void AccumulatorBufferGroup::handOffTo(AccumulatorBufferGroup& other)
diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp
index bf6189dd25..9dac4f6771 100644
--- a/indra/llcommon/lltracethreadrecorder.cpp
+++ b/indra/llcommon/lltracethreadrecorder.cpp
@@ -80,7 +80,7 @@ void ThreadRecorder::init()
TimeBlock::getRootTimeBlock().getCurrentAccumulator().mActiveCount = 1;
- claim_alloc(gTraceMemStat, sizeof(*this));
+ claim_alloc(gTraceMemStat, this);
claim_alloc(gTraceMemStat, sizeof(BlockTimer));
claim_alloc(gTraceMemStat, sizeof(TimeBlockTreeNode) * mNumTimeBlockTreeNodes);
}
@@ -98,7 +98,7 @@ ThreadRecorder::~ThreadRecorder()
{
LLThreadLocalSingletonPointer<BlockTimerStackRecord>::setInstance(NULL);
- disclaim_alloc(gTraceMemStat, sizeof(*this));
+ disclaim_alloc(gTraceMemStat, this);
disclaim_alloc(gTraceMemStat, sizeof(BlockTimer));
disclaim_alloc(gTraceMemStat, sizeof(TimeBlockTreeNode) * mNumTimeBlockTreeNodes);
@@ -190,13 +190,13 @@ ThreadRecorder::active_recording_list_t::iterator ThreadRecorder::bringUpToDate(
void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording )
{
- active_recording_list_t::iterator recording_to_remove = bringUpToDate(recording);
- if (recording_to_remove != mActiveRecordings.end())
+ active_recording_list_t::iterator recording_it = bringUpToDate(recording);
+ if (recording_it != mActiveRecordings.end())
{
- bool was_current = (*recording_to_remove)->mPartialRecording.isCurrent();
- llassert((*recording_to_remove)->mTargetRecording == recording);
- delete *recording_to_remove;
- mActiveRecordings.erase(recording_to_remove);
+ ActiveRecording* recording_to_remove = *recording_it;
+ bool was_current = recording_to_remove->mPartialRecording.isCurrent();
+ llassert(recording_to_remove->mTargetRecording == recording);
+ mActiveRecordings.erase(recording_it);
if (was_current)
{
if (mActiveRecordings.empty())
@@ -208,6 +208,7 @@ void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording )
mActiveRecordings.back()->mPartialRecording.makeCurrent();
}
}
+ delete recording_to_remove;
}
}