1
0

Added LuaState tracker and memory stats logging.

This commit is contained in:
Mattes D
2015-09-28 21:30:31 +02:00
parent a59800ca0c
commit 1c8e60f91a
3 changed files with 118 additions and 0 deletions

View File

@@ -145,6 +145,8 @@ cServer::cServer(void) :
m_ShouldLoadOfflinePlayerData(false),
m_ShouldLoadNamedPlayerData(true)
{
// Initialize the LuaStateTracker singleton before the app goes multithreaded:
cLuaStateTracker::GetStats();
}
@@ -522,6 +524,13 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
a_Output.Finished();
return;
}
else if (split[0].compare("luastats") == 0)
{
a_Output.Out(cLuaStateTracker::GetStats());
a_Output.Finished();
return;
}
#if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER)
else if (split[0].compare("dumpmem") == 0)
{