@@ -290,7 +290,7 @@ GCObject *luaC_newobj (lua_State *L, lu_byte tt, size_t sz) {
290
290
** (only closures can), and a userdata's metatable must be a table.
291
291
*/
292
292
static void reallymarkobject (global_State * g , GCObject * o ) {
293
- g -> marked ++ ;
293
+ g -> GCmarked ++ ;
294
294
switch (o -> tt ) {
295
295
case LUA_VSHRSTR :
296
296
case LUA_VLNGSTR : {
@@ -401,7 +401,7 @@ static void cleargraylists (global_State *g) {
401
401
*/
402
402
static void restartcollection (global_State * g ) {
403
403
cleargraylists (g );
404
- g -> marked = NFIXED ;
404
+ g -> GCmarked = NFIXED ;
405
405
markobject (g , g -> mainthread );
406
406
markvalue (g , & g -> l_registry );
407
407
markmt (g );
@@ -781,7 +781,7 @@ static void freeupval (lua_State *L, UpVal *uv) {
781
781
782
782
783
783
static void freeobj (lua_State * L , GCObject * o ) {
784
- G (L )-> totalobjs -- ;
784
+ G (L )-> GCtotalobjs -- ;
785
785
switch (o -> tt ) {
786
786
case LUA_VPROTO :
787
787
luaF_freeproto (L , gco2p (o ));
@@ -1052,7 +1052,7 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
1052
1052
** approximately (marked * pause / 100).
1053
1053
*/
1054
1054
static void setpause (global_State * g ) {
1055
- l_obj threshold = applygcparam (g , PAUSE , g -> marked );
1055
+ l_obj threshold = applygcparam (g , PAUSE , g -> GCmarked );
1056
1056
l_obj debt = threshold - gettotalobjs (g );
1057
1057
if (debt < 0 ) debt = 0 ;
1058
1058
luaE_setdebt (g , debt );
@@ -1236,7 +1236,7 @@ static void finishgencycle (lua_State *L, global_State *g) {
1236
1236
** in generational mode.
1237
1237
*/
1238
1238
static void minor2inc (lua_State * L , global_State * g , lu_byte kind ) {
1239
- g -> GCmajorminor = g -> marked ; /* number of live objects */
1239
+ g -> GCmajorminor = g -> GCmarked ; /* number of live objects */
1240
1240
g -> gckind = kind ;
1241
1241
g -> reallyold = g -> old1 = g -> survival = NULL ;
1242
1242
g -> finobjrold = g -> finobjold1 = g -> finobjsur = NULL ;
@@ -1260,7 +1260,7 @@ static void minor2inc (lua_State *L, global_State *g, lu_byte kind) {
1260
1260
static int checkminormajor (global_State * g , l_obj addedold1 ) {
1261
1261
l_obj step = applygcparam (g , MINORMUL , g -> GCmajorminor );
1262
1262
l_obj limit = applygcparam (g , MINORMAJOR , g -> GCmajorminor );
1263
- return (addedold1 >= (step >> 1 ) || g -> marked >= limit );
1263
+ return (addedold1 >= (step >> 1 ) || g -> GCmarked >= limit );
1264
1264
}
1265
1265
1266
1266
/*
@@ -1270,7 +1270,7 @@ static int checkminormajor (global_State *g, l_obj addedold1) {
1270
1270
*/
1271
1271
static void youngcollection (lua_State * L , global_State * g ) {
1272
1272
l_obj addedold1 = 0 ;
1273
- l_obj marked = g -> marked ; /* preserve 'g->marked ' */
1273
+ l_obj marked = g -> GCmarked ; /* preserve 'g->GCmarked ' */
1274
1274
GCObject * * psurvival ; /* to point to first non-dead survival object */
1275
1275
GCObject * dummy ; /* dummy out parameter to 'sweepgen' */
1276
1276
lua_assert (g -> gcstate == GCSpropagate );
@@ -1304,12 +1304,12 @@ static void youngcollection (lua_State *L, global_State *g) {
1304
1304
sweepgen (L , g , & g -> tobefnz , NULL , & dummy , & addedold1 );
1305
1305
1306
1306
/* keep total number of added old1 objects */
1307
- g -> marked = marked + addedold1 ;
1307
+ g -> GCmarked = marked + addedold1 ;
1308
1308
1309
1309
/* decide whether to shift to major mode */
1310
1310
if (checkminormajor (g , addedold1 )) {
1311
1311
minor2inc (L , g , KGC_GENMAJOR ); /* go to major mode */
1312
- g -> marked = 0 ; /* avoid pause in first major cycle */
1312
+ g -> GCmarked = 0 ; /* avoid pause in first major cycle */
1313
1313
}
1314
1314
else
1315
1315
finishgencycle (L , g ); /* still in minor mode; finish it */
@@ -1338,8 +1338,8 @@ static void atomic2gen (lua_State *L, global_State *g) {
1338
1338
sweep2old (L , & g -> tobefnz );
1339
1339
1340
1340
g -> gckind = KGC_GENMINOR ;
1341
- g -> GCmajorminor = g -> marked ; /* "base" for number of objects */
1342
- g -> marked = 0 ; /* to count the number of added old1 objects */
1341
+ g -> GCmajorminor = g -> GCmarked ; /* "base" for number of objects */
1342
+ g -> GCmarked = 0 ; /* to count the number of added old1 objects */
1343
1343
finishgencycle (L , g );
1344
1344
}
1345
1345
@@ -1407,14 +1407,14 @@ static int checkmajorminor (lua_State *L, global_State *g) {
1407
1407
l_obj numobjs = gettotalobjs (g );
1408
1408
l_obj addedobjs = numobjs - g -> GCmajorminor ;
1409
1409
l_obj limit = applygcparam (g , MAJORMINOR , addedobjs );
1410
- l_obj tobecollected = numobjs - g -> marked ;
1410
+ l_obj tobecollected = numobjs - g -> GCmarked ;
1411
1411
if (tobecollected > limit ) {
1412
1412
atomic2gen (L , g ); /* return to generational mode */
1413
1413
setminordebt (g );
1414
1414
return 0 ; /* exit incremental collection */
1415
1415
}
1416
1416
}
1417
- g -> GCmajorminor = g -> marked ; /* prepare for next collection */
1417
+ g -> GCmajorminor = g -> GCmarked ; /* prepare for next collection */
1418
1418
return 1 ; /* stay doing incremental collections */
1419
1419
}
1420
1420
@@ -1692,7 +1692,7 @@ static void fullinc (lua_State *L, global_State *g) {
1692
1692
luaC_runtilstate (L , GCSpause , 1 );
1693
1693
luaC_runtilstate (L , GCScallfin , 1 ); /* run up to finalizers */
1694
1694
/* 'marked' must be correct after a full GC cycle */
1695
- lua_assert (g -> marked == gettotalobjs (g ));
1695
+ lua_assert (g -> GCmarked == gettotalobjs (g ));
1696
1696
luaC_runtilstate (L , GCSpause , 1 ); /* finish collection */
1697
1697
setpause (g );
1698
1698
}
0 commit comments