mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Add LUA_GCCOUNTB option for lua_gc (#254)
Co-authored-by: Petri Häkkinen <petrih@rmd.remedy.fi>
This commit is contained in:
parent
f86d4c6995
commit
9aa9ff12dd
2 changed files with 6 additions and 0 deletions
|
@ -231,6 +231,7 @@ enum lua_GCOp
|
||||||
LUA_GCRESTART,
|
LUA_GCRESTART,
|
||||||
LUA_GCCOLLECT,
|
LUA_GCCOLLECT,
|
||||||
LUA_GCCOUNT,
|
LUA_GCCOUNT,
|
||||||
|
LUA_GCCOUNTB,
|
||||||
LUA_GCISRUNNING,
|
LUA_GCISRUNNING,
|
||||||
|
|
||||||
// garbage collection is handled by 'assists' that perform some amount of GC work matching pace of allocation
|
// garbage collection is handled by 'assists' that perform some amount of GC work matching pace of allocation
|
||||||
|
|
|
@ -1039,6 +1039,11 @@ int lua_gc(lua_State* L, int what, int data)
|
||||||
res = cast_int(g->totalbytes >> 10);
|
res = cast_int(g->totalbytes >> 10);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case LUA_GCCOUNTB:
|
||||||
|
{
|
||||||
|
res = cast_int(g->totalbytes & 1023);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case LUA_GCISRUNNING:
|
case LUA_GCISRUNNING:
|
||||||
{
|
{
|
||||||
res = (g->GCthreshold != SIZE_MAX);
|
res = (g->GCthreshold != SIZE_MAX);
|
||||||
|
|
Loading…
Add table
Reference in a new issue