diff --git a/src/lj_api.c b/src/lj_api.c index 1ad71678..548bef22 100644 --- a/src/lj_api.c +++ b/src/lj_api.c @@ -1297,6 +1297,9 @@ LUA_API int lua_gc(lua_State *L, int what, int data) case LUA_GCISRUNNING: res = (g->gc.threshold != LJ_MAX_MEM); break; + case LUA_GCESTIMATE: + res = (int)(g->gc.estimate >> 10); + break; default: res = -1; /* Invalid option. */ } diff --git a/src/lua.h b/src/lua.h index 6d1634d1..6655faad 100644 --- a/src/lua.h +++ b/src/lua.h @@ -228,6 +228,7 @@ LUA_API int (lua_status) (lua_State *L); #define LUA_GCSETPAUSE 6 #define LUA_GCSETSTEPMUL 7 #define LUA_GCISRUNNING 9 +#define LUA_GCESTIMATE 10 LUA_API int (lua_gc) (lua_State *L, int what, int data);