summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltrace.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-09-27 21:25:12 -0700
committerRichard Linden <none@none>2013-09-27 21:25:12 -0700
commit57d4f84f7c9b0b5d81c08d64c904dc4ad3dd4dfa (patch)
tree74fda37ffcfdeca3daf0e96a305e27ef4f9f7524 /indra/llcommon/lltrace.h
parent7d635773dddb5ebc42a4c3eeae84a35055fea537 (diff)
parentaf6b6db264aaa02e9e6a01d88233d129cf960fdf (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/llcommon/lltrace.h')
-rw-r--r--indra/llcommon/lltrace.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
index 355617a898..5c68bbbc0b 100644
--- a/indra/llcommon/lltrace.h
+++ b/indra/llcommon/lltrace.h
@@ -283,30 +283,34 @@ public:
inline void claim_footprint(MemStatHandle& measurement, S32 size)
{
+ if(size == 0) return;
MemStatAccumulator& accumulator = measurement.getCurrentAccumulator();
accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size);
- accumulator.mAllocated.add(1);
+ accumulator.mFootprintAllocations.record(size);
}
inline void disclaim_footprint(MemStatHandle& measurement, S32 size)
{
+ if(size == 0) return;
MemStatAccumulator& accumulator = measurement.getCurrentAccumulator();
accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size);
- accumulator.mDeallocated.add(1);
+ accumulator.mFootprintDeallocations.add(size);
}
inline void claim_shadow(MemStatHandle& measurement, S32 size)
{
+ if(size == 0) return;
MemStatAccumulator& accumulator = measurement.getCurrentAccumulator();
accumulator.mShadowSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size);
- accumulator.mShadowAllocated.add(1);
+ accumulator.mShadowAllocations.record(size);
}
inline void disclaim_shadow(MemStatHandle& measurement, S32 size)
{
+ if(size == 0) return;
MemStatAccumulator& accumulator = measurement.getCurrentAccumulator();
accumulator.mShadowSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size);
- accumulator.mShadowDeallocated.add(1);
+ accumulator.mShadowDeallocations.add(size);
}
// measures effective memory footprint of specified type
@@ -465,13 +469,13 @@ public:
void *operator new [](size_t size)
{
- claim_footprint(sMemStat, size);
+ claim_footprint(sMemStat, size, true);
return ll_aligned_malloc(ALIGNMENT, size);
}
void operator delete[](void* ptr, size_t size)
{
- disclaim_footprint(sMemStat, size);
+ disclaim_footprint(sMemStat, size, true);
ll_aligned_free(ALIGNMENT, ptr);
}