mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 09:39:56 +00:00
Run Lua GC in every frame
This commit is contained in:
parent
55db95d4cf
commit
7c36a7eb49
@ -132,6 +132,10 @@ namespace MWLua
|
|||||||
void LuaManager::update()
|
void LuaManager::update()
|
||||||
{
|
{
|
||||||
static const bool luaDebug = Settings::Manager::getBool("lua debug", "Lua");
|
static const bool luaDebug = Settings::Manager::getBool("lua debug", "Lua");
|
||||||
|
static const int gcStepCount = Settings::Manager::getInt("gc steps per frame", "Lua");
|
||||||
|
if (gcStepCount > 0)
|
||||||
|
lua_gc(mLua.sol(), LUA_GCSTEP, gcStepCount);
|
||||||
|
|
||||||
if (mPlayer.isEmpty())
|
if (mPlayer.isEmpty())
|
||||||
return; // The game is not started yet.
|
return; // The game is not started yet.
|
||||||
|
|
||||||
|
@ -87,3 +87,14 @@ If exceeded (e.g. because of an infinite loop) the function will be terminated.
|
|||||||
|
|
||||||
This setting can only be configured by editing the settings configuration file.
|
This setting can only be configured by editing the settings configuration file.
|
||||||
|
|
||||||
|
gc steps per frame
|
||||||
|
------------------
|
||||||
|
|
||||||
|
:Type: integer
|
||||||
|
:Range: >= 0
|
||||||
|
:Default: 100
|
||||||
|
|
||||||
|
Lua garbage collector steps per frame. The higher the value the more time Lua runtime can spend on freeing unused memory.
|
||||||
|
|
||||||
|
This setting can only be configured by editing the settings configuration file.
|
||||||
|
|
||||||
|
@ -1158,6 +1158,9 @@ log memory usage = false
|
|||||||
# If exceeded (e.g. because of an infinite loop) the function will be terminated.
|
# If exceeded (e.g. because of an infinite loop) the function will be terminated.
|
||||||
instruction limit per call = 100000000
|
instruction limit per call = 100000000
|
||||||
|
|
||||||
|
# Lua garbage collector steps per frame.
|
||||||
|
gc steps per frame = 100
|
||||||
|
|
||||||
[Stereo]
|
[Stereo]
|
||||||
# Enable/disable stereo view. This setting is ignored in VR.
|
# Enable/disable stereo view. This setting is ignored in VR.
|
||||||
stereo enabled = false
|
stereo enabled = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user