13
0

Tweak Lua GC

This commit is contained in:
Robin Gareus 2017-11-29 12:03:18 +01:00
parent 44cf448839
commit 77d16999b5
4 changed files with 5 additions and 5 deletions

View File

@ -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 ();

View File

@ -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*/);
}
}

View File

@ -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);

View File

@ -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