aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-09 16:55:17 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-09 16:55:17 -0200
commit1ce819333d3f02d14d983dbddb236e72d4555c7f (patch)
treed77bbff87e140161cb6b0e6d423da1123de10e88 /lapi.c
parent88eb901f81d647714d14b6f7e7c6455b46a27daa (diff)
downloadlua-1ce819333d3f02d14d983dbddb236e72d4555c7f.tar.gz
lua-1ce819333d3f02d14d983dbddb236e72d4555c7f.tar.bz2
lua-1ce819333d3f02d14d983dbddb236e72d4555c7f.zip
new option 'isrunning' for 'lua_gc' (and 'collectgarbage')
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index a8eb128c..b8de12a9 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.97 2009/11/06 17:03:37 roberto Exp roberto $ 2** $Id: lapi.c,v 2.98 2009/11/09 18:29:21 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -953,6 +953,10 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
953 g->gcstepmul = data; 953 g->gcstepmul = data;
954 break; 954 break;
955 } 955 }
956 case LUA_GCISRUNNING: {
957 res = (g->GCthreshold != MAX_LUMEM);
958 break;
959 }
956 default: res = -1; /* invalid option */ 960 default: res = -1; /* invalid option */
957 } 961 }
958 lua_unlock(L); 962 lua_unlock(L);