diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-09-06 14:38:39 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-09-06 14:38:39 -0300 |
| commit | a04e0ffdb9be42a77b5657f46cac8d7faa5a0f43 (patch) | |
| tree | eb96915b808cf929015452bd08ca1e5c571683ce /lmem.c | |
| parent | 007b8c7a01eaa97d796561a19c7e9af1ec474495 (diff) | |
| download | lua-a04e0ffdb9be42a77b5657f46cac8d7faa5a0f43.tar.gz lua-a04e0ffdb9be42a77b5657f46cac8d7faa5a0f43.tar.bz2 lua-a04e0ffdb9be42a77b5657f46cac8d7faa5a0f43.zip | |
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'.
Diffstat (limited to 'lmem.c')
| -rw-r--r-- | lmem.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -151,7 +151,7 @@ void luaM_free_ (lua_State *L, void *block, size_t osize) { | |||
| 151 | global_State *g = G(L); | 151 | global_State *g = G(L); |
| 152 | lua_assert((osize == 0) == (block == NULL)); | 152 | lua_assert((osize == 0) == (block == NULL)); |
| 153 | callfrealloc(g, block, osize, 0); | 153 | callfrealloc(g, block, osize, 0); |
| 154 | g->totalbytes -= osize; | 154 | g->GCtotalbytes -= osize; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | 157 | ||
| @@ -181,10 +181,10 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { | |||
| 181 | if (l_unlikely(newblock == NULL && nsize > 0)) { | 181 | if (l_unlikely(newblock == NULL && nsize > 0)) { |
| 182 | newblock = tryagain(L, block, osize, nsize); | 182 | newblock = tryagain(L, block, osize, nsize); |
| 183 | if (newblock == NULL) /* still no memory? */ | 183 | if (newblock == NULL) /* still no memory? */ |
| 184 | return NULL; /* do not update 'totalbytes' */ | 184 | return NULL; /* do not update 'GCtotalbytes' */ |
| 185 | } | 185 | } |
| 186 | lua_assert((nsize == 0) == (newblock == NULL)); | 186 | lua_assert((nsize == 0) == (newblock == NULL)); |
| 187 | g->totalbytes += nsize - osize; | 187 | g->GCtotalbytes += nsize - osize; |
| 188 | return newblock; | 188 | return newblock; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| @@ -209,7 +209,7 @@ void *luaM_malloc_ (lua_State *L, size_t size, int tag) { | |||
| 209 | if (newblock == NULL) | 209 | if (newblock == NULL) |
| 210 | luaM_error(L); | 210 | luaM_error(L); |
| 211 | } | 211 | } |
| 212 | g->totalbytes += size; | 212 | g->GCtotalbytes += size; |
| 213 | return newblock; | 213 | return newblock; |
| 214 | } | 214 | } |
| 215 | } | 215 | } |
