mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-22 00:41:33 +00:00
Remove Ui Content counter in Lua profiler
This commit is contained in:
parent
bbbef96087
commit
fb0646dda1
3 changed files with 0 additions and 24 deletions
|
@ -644,7 +644,6 @@ namespace MWLua
|
||||||
outMemSize(mLua.getTotalMemoryUsage());
|
outMemSize(mLua.getTotalMemoryUsage());
|
||||||
out << "\n";
|
out << "\n";
|
||||||
out << "LuaUtil::ScriptsContainer count: " << LuaUtil::ScriptsContainer::getInstanceCount() << "\n";
|
out << "LuaUtil::ScriptsContainer count: " << LuaUtil::ScriptsContainer::getInstanceCount() << "\n";
|
||||||
out << "LuaUi::Content count: " << LuaUi::Content::getInstanceCount() << "\n";
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
out << "small alloc max size = " << smallAllocSize << " (section [Lua] in settings.cfg)\n";
|
out << "small alloc max size = " << smallAllocSize << " (section [Lua] in settings.cfg)\n";
|
||||||
out << "Smaller values give more information for the profiler, but increase performance overhead.\n";
|
out << "Smaller values give more information for the profiler, but increase performance overhead.\n";
|
||||||
|
|
|
@ -11,11 +11,4 @@ namespace LuaUi::Content
|
||||||
throw std::logic_error("Expected function");
|
throw std::logic_error("Expected function");
|
||||||
return metatable["new"].get<sol::protected_function>();
|
return metatable["new"].get<sol::protected_function>();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t View::sInstanceCount = 0;
|
|
||||||
|
|
||||||
int64_t getInstanceCount()
|
|
||||||
{
|
|
||||||
return View::sInstanceCount;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,27 +15,13 @@ namespace LuaUi::Content
|
||||||
class View
|
class View
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static int64_t sInstanceCount; // debug information, shown in Lua profiler
|
|
||||||
|
|
||||||
// accepts only Lua tables returned by ui.content
|
// accepts only Lua tables returned by ui.content
|
||||||
explicit View(sol::table table)
|
explicit View(sol::table table)
|
||||||
: mTable(std::move(table))
|
: mTable(std::move(table))
|
||||||
{
|
{
|
||||||
if (!isValid(mTable))
|
if (!isValid(mTable))
|
||||||
throw std::domain_error("Expected a Content table");
|
throw std::domain_error("Expected a Content table");
|
||||||
sInstanceCount++;
|
|
||||||
}
|
}
|
||||||
View(const View& c)
|
|
||||||
{
|
|
||||||
this->mTable = c.mTable;
|
|
||||||
sInstanceCount++;
|
|
||||||
}
|
|
||||||
View(View&& c)
|
|
||||||
{
|
|
||||||
this->mTable = std::move(c.mTable);
|
|
||||||
sInstanceCount++;
|
|
||||||
}
|
|
||||||
~View() { sInstanceCount--; }
|
|
||||||
|
|
||||||
static bool isValid(const sol::object& object)
|
static bool isValid(const sol::object& object)
|
||||||
{
|
{
|
||||||
|
@ -123,8 +109,6 @@ namespace LuaUi::Content
|
||||||
static inline size_t toLua(size_t index) { return index + 1; }
|
static inline size_t toLua(size_t index) { return index + 1; }
|
||||||
static inline size_t fromLua(size_t index) { return index - 1; }
|
static inline size_t fromLua(size_t index) { return index - 1; }
|
||||||
};
|
};
|
||||||
|
|
||||||
int64_t getInstanceCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // COMPONENTS_LUAUI_CONTENT
|
#endif // COMPONENTS_LUAUI_CONTENT
|
||||||
|
|
Loading…
Reference in a new issue