Fixed LLFastTimers et al.

No longer crash when std::vector moves in memory when it grows.
Fixed display of timer values (in ms).
This commit is contained in:
Aleric Inglewood
2012-02-04 18:28:24 +01:00
parent b755bcd495
commit 5a455eac91
5 changed files with 201 additions and 68 deletions

View File

@@ -38,6 +38,8 @@
#include "aithreadsafe.h"
#include "aistatemachine.h"
extern F64 calc_clock_frequency(void);
extern LLControlGroup gSavedSettings;
// Local variables.
@@ -79,7 +81,7 @@ AITHREADSAFESIMPLE(U64, AIStateMachine::sMaxCount, );
void AIStateMachine::updateSettings(void)
{
Dout(dc::statemachine, "Initializing AIStateMachine::sMaxCount");
*AIAccess<U64>(sMaxCount) = LLFastTimer::sClockResolution * gSavedSettings.getU32("StateMachineMaxTime") / 1000;
*AIAccess<U64>(sMaxCount) = calc_clock_frequency() * gSavedSettings.getU32("StateMachineMaxTime") / 1000;
}
//----------------------------------------------------------------------------
@@ -320,7 +322,7 @@ void AIStateMachine::mainloop(void*)
if (total_clocks >= max_count)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
llwarns << "AIStateMachine::mainloop did run for " << (total_clocks * 1000 / LLFastTimer::sClockResolution) << " ms." << llendl;
llwarns << "AIStateMachine::mainloop did run for " << (total_clocks * 1000 / calc_clock_frequency()) << " ms." << llendl;
#endif
std::sort(active_statemachines.begin(), active_statemachines.end(), QueueElementComp());
break;