diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-06 03:32:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-06 03:32:08 +0200 |
commit | a2f249d1d7a14498f9b1c0b46f89be4a7e611c37 (patch) | |
tree | 9a01592aa4209a9b3694c190d10ba809337fc833 /libs/lua/luastate.cc | |
parent | aee63fe5a3cc2b718756d7963c0799cbd7728cea (diff) |
tweak lua gc
lua C++ bindings require ~400KB worth of tables now; so bump memory
available to rt-safe scripts (full interpreter) to 2MB.
Also switch to incremental GC.
Diffstat (limited to 'libs/lua/luastate.cc')
-rw-r--r-- | libs/lua/luastate.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/lua/luastate.cc b/libs/lua/luastate.cc index 546b02a006..3b8a7ae25a 100644 --- a/libs/lua/luastate.cc +++ b/libs/lua/luastate.cc @@ -77,6 +77,17 @@ LuaState::collect_garbage () { } void +LuaState::collect_garbage_step () { + lua_gc (L, LUA_GCSTEP, 0); +} + +void +LuaState::tweak_rt_gc () { + //lua_gc (L, LUA_GCSETPAUSE, 20); + lua_gc (L, LUA_GCSETSTEPMUL, 100); +} + +void LuaState::print (std::string text) { Print (text); /* EMIT SIGNAL */ } |