diff options
| author | Richard Linden <none@none> | 2013-09-09 11:43:12 -0700 | 
|---|---|---|
| committer | Richard Linden <none@none> | 2013-09-09 11:43:12 -0700 | 
| commit | 4f44366731c6fb3bf62c29a5413dc8db86ab4f2e (patch) | |
| tree | 4675aca166c6f0d074da7f81958c7b9fefa754ff | |
| parent | 62d40c8d85c57158db226b25bac27f3e77672f8e (diff) | |
BUILDFIX: don't use typeinfo() in static object constructor of baseclass
| -rw-r--r-- | indra/llcommon/lltrace.h | 23 | 
1 files changed, 20 insertions, 3 deletions
| diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index d42c8e26fb..afa9933165 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -62,8 +62,8 @@ public:  	const std::string& getDescription() const { return mDescription; }  protected: -	const std::string	mName; -	const std::string	mDescription; +	std::string	mName; +	std::string	mDescription;  };  template<typename ACCUMULATOR> @@ -225,6 +225,12 @@ public:  	:	trace_t(name)  	{} +    void setName(const char* name) +    { +        mName = name; +        setKey(name); +    } +      	/*virtual*/ const char* getUnitLabel() const { return "B"; }  	TraceType<MemStatAccumulator::AllocationCountFacet>& allocationCount()  @@ -331,6 +337,17 @@ class MemTrackable  public:  	typedef void mem_trackable_tag_t; +    MemTrackable() +    { +        static bool name_initialized = false; +        if (!name_initialized) +        { +            name_initialized = true; +            sMemStat.setName(typeid(DERIVED).name()); +        } +    } +     +      	virtual ~MemTrackable()  	{  		memDisclaim(mMemFootprint); @@ -524,7 +541,7 @@ private:  // pretty sure typeid of containing class in static object constructor doesn't work in gcc  template<typename DERIVED, size_t ALIGNMENT> -MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(typeid(DERIVED).name()); +MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat("");  }  #endif // LL_LLTRACE_H | 
