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