From a04e0ffdb9be42a77b5657f46cac8d7faa5a0f43 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 6 Sep 2024 14:38:39 -0300 Subject: Rename of fields in global state that control GC All fields in the global state that control the pace of the garbage collector prefixed with 'GC'. --- lstate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index eb71ed8c..f4c9081d 100644 --- a/lstate.c +++ b/lstate.c @@ -74,15 +74,15 @@ typedef struct LG { /* ** set GCdebt to a new value keeping the real number of allocated -** objects (totalobjs - GCdebt) invariant and avoiding overflows in -** 'totalobjs'. +** objects (GCtotalobjs - GCdebt) invariant and avoiding overflows in +** 'GCtotalobjs'. */ void luaE_setdebt (global_State *g, l_obj debt) { l_obj tb = gettotalobjs(g); lua_assert(tb > 0); if (debt > MAX_LOBJ - tb) - debt = MAX_LOBJ - tb; /* will make 'totalobjs == MAX_LMEM' */ - g->totalobjs = tb + debt; + debt = MAX_LOBJ - tb; /* will make GCtotalobjs == MAX_LOBJ */ + g->GCtotalobjs = tb + debt; g->GCdebt = debt; } @@ -269,7 +269,7 @@ static void close_state (lua_State *L) { } luaM_freearray(L, G(L)->strt.hash, cast_sizet(G(L)->strt.size)); freestack(L); - lua_assert(g->totalbytes == sizeof(LG)); + lua_assert(g->GCtotalbytes == sizeof(LG)); lua_assert(gettotalobjs(g) == 1); (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ } @@ -378,9 +378,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned seed) { g->gray = g->grayagain = NULL; g->weak = g->ephemeron = g->allweak = NULL; g->twups = NULL; - g->totalbytes = sizeof(LG); - g->totalobjs = 1; - g->marked = 0; + g->GCtotalbytes = sizeof(LG); + g->GCtotalobjs = 1; + g->GCmarked = 0; g->GCdebt = 0; setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */ setgcparam(g, PAUSE, LUAI_GCPAUSE); -- cgit v1.2.3-55-g6feb