diff options
| author | Don Kjer <don@lindenlab.com> | 2012-08-17 01:41:07 +0000 |
|---|---|---|
| committer | Don Kjer <don@lindenlab.com> | 2012-08-17 01:41:07 +0000 |
| commit | 7ac0d2b8a31174b3d8872ec8ed5ed64c3d0bc7ed (patch) | |
| tree | 71ee0b4b8ed4f0f1a90f3138604b9d074087c4ad /indra/llcommon/llstat.cpp | |
| parent | 48b7eff75835058f144bbc27a5b2ef2997be2be4 (diff) | |
| parent | 7204593ec3f6fca63c32bcb8cdcf9c356165d24e (diff) | |
Merge viewer-development -> sunshine
Diffstat (limited to 'indra/llcommon/llstat.cpp')
| -rw-r--r-- | indra/llcommon/llstat.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/indra/llcommon/llstat.cpp b/indra/llcommon/llstat.cpp index 057257057f..b82d52797e 100644 --- a/indra/llcommon/llstat.cpp +++ b/indra/llcommon/llstat.cpp @@ -40,7 +40,6 @@ S32 LLPerfBlock::sStatsFlags = LLPerfBlock::LLSTATS_NO_OPTIONAL_STATS; // Control what is being recorded LLPerfBlock::stat_map_t LLPerfBlock::sStatMap; // Map full path string to LLStatTime objects, tracks all active objects std::string LLPerfBlock::sCurrentStatPath = ""; // Something like "/total_time/physics/physics step" -LLStat::stat_map_t LLStat::sStatList; //------------------------------------------------------------------------ // Live config file to trigger stats logging @@ -771,13 +770,19 @@ void LLStat::init() if (!mName.empty()) { - stat_map_t::iterator iter = sStatList.find(mName); - if (iter != sStatList.end()) + stat_map_t::iterator iter = getStatList().find(mName); + if (iter != getStatList().end()) llwarns << "LLStat with duplicate name: " << mName << llendl; - sStatList.insert(std::make_pair(mName, this)); + getStatList().insert(std::make_pair(mName, this)); } } +LLStat::stat_map_t& LLStat::getStatList() +{ + static LLStat::stat_map_t stat_list; + return stat_list; +} + LLStat::LLStat(const U32 num_bins, const BOOL use_frame_timer) : mUseFrameTimer(use_frame_timer), mNumBins(num_bins) @@ -803,10 +808,10 @@ LLStat::~LLStat() if (!mName.empty()) { // handle multiple entries with the same name - stat_map_t::iterator iter = sStatList.find(mName); - while (iter != sStatList.end() && iter->second != this) + stat_map_t::iterator iter = getStatList().find(mName); + while (iter != getStatList().end() && iter->second != this) ++iter; - sStatList.erase(iter); + getStatList().erase(iter); } } |
