summaryrefslogtreecommitdiff
path: root/src/lib_base.c
diff options
context:
space:
mode:
authorMike Pall <mike>2015-10-01 16:26:00 +0200
committerMike Pall <mike>2015-10-01 16:26:00 +0200
commit86c21bd245f7a1b1aef09999f502997f0656f127 (patch)
tree0a835431a518e50928b3bebe27d164d201110c0a /src/lib_base.c
parent0b09c971c9edfdd901c9a4480423cc786bce7a94 (diff)
downloadluajit-86c21bd245f7a1b1aef09999f502997f0656f127.tar.gz
luajit-86c21bd245f7a1b1aef09999f502997f0656f127.tar.bz2
luajit-86c21bd245f7a1b1aef09999f502997f0656f127.zip
Add collectgarbage("isrunning").
Diffstat (limited to 'src/lib_base.c')
-rw-r--r--src/lib_base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib_base.c b/src/lib_base.c
index 887fea7a..ca268b1d 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -435,13 +435,13 @@ LJLIB_CF(gcinfo)
435LJLIB_CF(collectgarbage) 435LJLIB_CF(collectgarbage)
436{ 436{
437 int opt = lj_lib_checkopt(L, 1, LUA_GCCOLLECT, /* ORDER LUA_GC* */ 437 int opt = lj_lib_checkopt(L, 1, LUA_GCCOLLECT, /* ORDER LUA_GC* */
438 "\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul"); 438 "\4stop\7restart\7collect\5count\1\377\4step\10setpause\12setstepmul\1\377\11isrunning");
439 int32_t data = lj_lib_optint(L, 2, 0); 439 int32_t data = lj_lib_optint(L, 2, 0);
440 if (opt == LUA_GCCOUNT) { 440 if (opt == LUA_GCCOUNT) {
441 setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0); 441 setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0);
442 } else { 442 } else {
443 int res = lua_gc(L, opt, data); 443 int res = lua_gc(L, opt, data);
444 if (opt == LUA_GCSTEP) 444 if (opt == LUA_GCSTEP || opt == LUA_GCISRUNNING)
445 setboolV(L->top, res); 445 setboolV(L->top, res);
446 else 446 else
447 setintV(L->top, res); 447 setintV(L->top, res);