diff --git a/VM/include/lua.h b/VM/include/lua.h index ebe7bbc..a2c7221 100644 --- a/VM/include/lua.h +++ b/VM/include/lua.h @@ -231,6 +231,7 @@ enum lua_GCOp LUA_GCRESTART, LUA_GCCOLLECT, LUA_GCCOUNT, + LUA_GCCOUNTB, LUA_GCISRUNNING, // garbage collection is handled by 'assists' that perform some amount of GC work matching pace of allocation diff --git a/VM/src/lapi.cpp b/VM/src/lapi.cpp index 832849a..3f4c0fd 100644 --- a/VM/src/lapi.cpp +++ b/VM/src/lapi.cpp @@ -1039,6 +1039,11 @@ int lua_gc(lua_State* L, int what, int data) res = cast_int(g->totalbytes >> 10); break; } + case LUA_GCCOUNTB: + { + res = cast_int(g->totalbytes & 1023); + break; + } case LUA_GCISRUNNING: { res = (g->GCthreshold != SIZE_MAX);