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.
This commit is contained in:
@@ -34,6 +34,8 @@ public:
|
||||
int do_command (std::string);
|
||||
int do_file (std::string);
|
||||
void collect_garbage ();
|
||||
void collect_garbage_step ();
|
||||
void tweak_rt_gc ();
|
||||
|
||||
sigc::signal<void,std::string> Print;
|
||||
|
||||
|
||||
@@ -76,6 +76,17 @@ LuaState::collect_garbage () {
|
||||
lua_gc (L, LUA_GCCOLLECT, 0);
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user