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'.
This commit is contained in:
Roberto Ierusalimschy
2024-09-06 14:38:39 -03:00
parent 007b8c7a01
commit a04e0ffdb9
5 changed files with 32 additions and 32 deletions

8
lmem.c
View File

@@ -151,7 +151,7 @@ void luaM_free_ (lua_State *L, void *block, size_t osize) {
global_State *g = G(L);
lua_assert((osize == 0) == (block == NULL));
callfrealloc(g, block, osize, 0);
g->totalbytes -= osize;
g->GCtotalbytes -= osize;
}
@@ -181,10 +181,10 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
if (l_unlikely(newblock == NULL && nsize > 0)) {
newblock = tryagain(L, block, osize, nsize);
if (newblock == NULL) /* still no memory? */
return NULL; /* do not update 'totalbytes' */
return NULL; /* do not update 'GCtotalbytes' */
}
lua_assert((nsize == 0) == (newblock == NULL));
g->totalbytes += nsize - osize;
g->GCtotalbytes += nsize - osize;
return newblock;
}
@@ -209,7 +209,7 @@ void *luaM_malloc_ (lua_State *L, size_t size, int tag) {
if (newblock == NULL)
luaM_error(L);
}
g->totalbytes += size;
g->GCtotalbytes += size;
return newblock;
}
}