summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llstat.cpp')
-rw-r--r--indra/llcommon/llstat.cpp19
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);
}
}