summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-07-06 03:32:08 +0200
committerRobin Gareus <robin@gareus.org>2016-07-06 03:32:08 +0200
commita2f249d1d7a14498f9b1c0b46f89be4a7e611c37 (patch)
tree9a01592aa4209a9b3694c190d10ba809337fc833 /libs/ardour/luaproc.cc
parentaee63fe5a3cc2b718756d7963c0799cbd7728cea (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/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index 03deea7114..3e7a01a399 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -46,7 +46,7 @@ LuaProc::LuaProc (AudioEngine& engine,
Session& session,
const std::string &script)
: Plugin (engine, session)
- , _mempool ("LuaProc", 1048576) // 1 MB is plenty. (64K would be enough)
+ , _mempool ("LuaProc", 2097152)
, lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
, _lua_dsp (0)
, _script (script)
@@ -69,7 +69,7 @@ LuaProc::LuaProc (AudioEngine& engine,
LuaProc::LuaProc (const LuaProc &other)
: Plugin (other)
- , _mempool ("LuaProc", 1048576) // 1 MB is plenty. (64K would be enough)
+ , _mempool ("LuaProc", 2097152)
, lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
, _lua_dsp (0)
, _script (other.script ())
@@ -118,6 +118,7 @@ LuaProc::init ()
_stats_avg[0] = _stats_avg[1] = _stats_max[0] = _stats_max[1] = _stats_cnt = 0;
#endif
+ lua.tweak_rt_gc ();
lua.Print.connect (sigc::mem_fun (*this, &LuaProc::lua_print));
// register session object
lua_State* L = lua.getState ();
@@ -759,7 +760,8 @@ LuaProc::connect_and_run (BufferSet& bufs,
#ifdef WITH_LUAPROC_STATS
int64_t t1 = g_get_monotonic_time ();
#endif
- lua.collect_garbage (); // rt-safe, slight *regular* performance overhead
+
+ lua.collect_garbage_step ();
#ifdef WITH_LUAPROC_STATS
++_stats_cnt;
int64_t t2 = g_get_monotonic_time ();