Exposing the GC Estimate Value to the API
This commit is contained in:
parent
87ae18af97
commit
e48198b77e
@ -1297,6 +1297,9 @@ LUA_API int lua_gc(lua_State *L, int what, int data)
|
|||||||
case LUA_GCISRUNNING:
|
case LUA_GCISRUNNING:
|
||||||
res = (g->gc.threshold != LJ_MAX_MEM);
|
res = (g->gc.threshold != LJ_MAX_MEM);
|
||||||
break;
|
break;
|
||||||
|
case LUA_GCESTIMATE:
|
||||||
|
res = (int)(g->gc.estimate >> 10);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
res = -1; /* Invalid option. */
|
res = -1; /* Invalid option. */
|
||||||
}
|
}
|
||||||
|
|||||||
@ -228,6 +228,7 @@ LUA_API int (lua_status) (lua_State *L);
|
|||||||
#define LUA_GCSETPAUSE 6
|
#define LUA_GCSETPAUSE 6
|
||||||
#define LUA_GCSETSTEPMUL 7
|
#define LUA_GCSETSTEPMUL 7
|
||||||
#define LUA_GCISRUNNING 9
|
#define LUA_GCISRUNNING 9
|
||||||
|
#define LUA_GCESTIMATE 10
|
||||||
|
|
||||||
LUA_API int (lua_gc) (lua_State *L, int what, int data);
|
LUA_API int (lua_gc) (lua_State *L, int what, int data);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user