mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-19 05:23:27 +00:00
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:
|
||||
res = (g->gc.threshold != LJ_MAX_MEM);
|
||||
break;
|
||||
case LUA_GCESTIMATE:
|
||||
res = (int)(g->gc.estimate >> 10);
|
||||
break;
|
||||
default:
|
||||
res = -1; /* Invalid option. */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user