diff options
author | Richard Linden <none@none> | 2013-07-01 18:50:51 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-07-01 18:50:51 -0700 |
commit | 8208a40412fac35593d4b8b13f43c6be5e4d6990 (patch) | |
tree | 471e6f687612b1c6960f28ef8acda809526d68ad /indra/llcommon/lltrace.h | |
parent | 04bdc8ba83c297945dd60489c241b88adf892ff4 (diff) |
BUILDFIX: reverted changes that attempted to automate mem track
stat definition as they don't work on gcc/clang
Diffstat (limited to 'indra/llcommon/lltrace.h')
-rw-r--r-- | indra/llcommon/lltrace.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 1cde450dc2..e2c4b63276 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -336,7 +336,7 @@ public: void* operator new(size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); @@ -348,7 +348,7 @@ public: void operator delete(void* ptr, size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); @@ -360,7 +360,7 @@ public: void *operator new [](size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); @@ -372,7 +372,7 @@ public: void operator delete[](void* ptr, size_t size) { - MemStatAccumulator* accumulator = mem_trackable_t::sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); @@ -438,15 +438,13 @@ public: private: size_t mMemFootprint; - static MemStatHandle sMemStat; - template<typename TRACKED, typename TRACKED_IS_TRACKER = void> struct TrackMemImpl { static void claim(mem_trackable_t& tracker, const TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { size_t footprint = MemFootprint<TRACKED>::measure(tracked); @@ -457,7 +455,7 @@ private: static void disclaim(mem_trackable_t& tracker, const TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { size_t footprint = MemFootprint<TRACKED>::measure(tracked); @@ -472,7 +470,7 @@ private: { static void claim(mem_trackable_t& tracker, TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() + (F64)MemFootprint<TRACKED>::measure(tracked)); @@ -481,7 +479,7 @@ private: static void disclaim(mem_trackable_t& tracker, TRACKED& tracked) { - MemStatAccumulator* accumulator = sMemStat.getPrimaryAccumulator(); + MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() - (F64)MemFootprint<TRACKED>::measure(tracked)); @@ -490,9 +488,5 @@ private: }; }; -template<typename DERIVED, size_t ALIGNMENT> -MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(typeid(DERIVED).name()); - - } #endif // LL_LLTRACE_H |