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:
8
lmem.c
8
lmem.c
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user