lua_gc (L, LUA_GCCOLLECT, 0);
}
+void
+LuaState::collect_garbage_step (int debt) {
+ lua_gc (L, LUA_GCSTEP, debt);
+}
+
+void
+LuaState::tweak_rt_gc () {
+ /* GC runs same speed as memory allocation */
+ lua_gc (L, LUA_GCSETPAUSE, 100);
+ lua_gc (L, LUA_GCSETSTEPMUL, 100);
+}
+
+void
+LuaState::sandbox (bool rt_safe) {
+ do_command ("dofile = nil require = nil dofile = nil package = nil debug = nil os.exit = nil os.setlocale = nil rawget = nil rawset = nil coroutine = nil module = nil");
+ if (rt_safe) {
+ do_command ("os = nil io = nil loadfile = nil");
+ }
+}
+
+
void
LuaState::print (std::string text) {
Print (text); /* EMIT SIGNAL */