diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-29 12:03:18 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-29 12:06:42 +0100 |
commit | 77d16999b536364d9a5ef430c36d0ef0863533a7 (patch) | |
tree | 10ccb2b268577ce21cae4aa51fbe0cd5f4f4b415 | |
parent | 44cf44883927c06fd0b8277c292716ea20be4eb9 (diff) |
Tweak Lua GC
-rw-r--r-- | libs/ardour/luaproc.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 | ||||
-rw-r--r-- | libs/lua/lua/luastate.h | 2 | ||||
-rw-r--r-- | libs/lua/luastate.cc | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 6617e8582f..9122fb32fb 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -744,7 +744,7 @@ LuaProc::connect_and_run (BufferSet& bufs, int64_t t1 = g_get_monotonic_time (); #endif - lua.collect_garbage_step (); + lua.collect_garbage_step (100 /*kB*/); #ifdef WITH_LUAPROC_STATS ++_stats_cnt; int64_t t2 = g_get_monotonic_time (); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index dabd4bc187..039288952b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -5486,7 +5486,7 @@ Session::try_run_lua (pframes_t nframes) Glib::Threads::Mutex::Lock tm (lua_lock, Glib::Threads::TRY_LOCK); if (tm.locked ()) { try { (*_lua_run)(nframes); } catch (...) { } - lua.collect_garbage_step (); + lua.collect_garbage_step (100 /*kB*/); } } diff --git a/libs/lua/lua/luastate.h b/libs/lua/lua/luastate.h index cdc7f2b2bf..1b55a1e706 100644 --- a/libs/lua/lua/luastate.h +++ b/libs/lua/lua/luastate.h @@ -34,7 +34,7 @@ public: int do_command (std::string); int do_file (std::string); void collect_garbage (); - void collect_garbage_step (); + void collect_garbage_step (int debt = 0); void tweak_rt_gc (); void sandbox (bool rt_safe = false); diff --git a/libs/lua/luastate.cc b/libs/lua/luastate.cc index 80ce41944c..f9dbbbaf29 100644 --- a/libs/lua/luastate.cc +++ b/libs/lua/luastate.cc @@ -77,8 +77,8 @@ LuaState::collect_garbage () { } void -LuaState::collect_garbage_step () { - lua_gc (L, LUA_GCSTEP, 0); +LuaState::collect_garbage_step (int debt) { + lua_gc (L, LUA_GCSTEP, debt); } void |