aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-29 17:05:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-29 17:05:47 -0300
commit0dc5deca1c0182a4a3db2fcfd7bc721f27fb352b (patch)
treeb7af445c2b08aa760b3315c6083c4bb30387f2ee /lstate.c
parentb4c353434f28f3e9d4c45e61d42b4fd07d76cad2 (diff)
downloadlua-0dc5deca1c0182a4a3db2fcfd7bc721f27fb352b.tar.gz
lua-0dc5deca1c0182a4a3db2fcfd7bc721f27fb352b.tar.bz2
lua-0dc5deca1c0182a4a3db2fcfd7bc721f27fb352b.zip
Optimization in 'markold'
OLD1 objects can be potentially anywhere in the 'allgc' list (up to 'reallyold'), but frequently they are all after 'old1' (natural evolution of survivals) or do not exist at all (when all objects die young). So, instead of 'markold' starts looking for them always from the start of 'allgc', the collector keeps an extra pointer, 'firstold1', that points to the first OLD1 object in the 'allgc' list, or is NULL if there are no OLD1 objects in that list.
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 38a2b45a..86b3761f 100644
--- a/lstate.c
+++ b/lstate.c
@@ -413,7 +413,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
413 g->gckind = KGC_INC; 413 g->gckind = KGC_INC;
414 g->gcemergency = 0; 414 g->gcemergency = 0;
415 g->finobj = g->tobefnz = g->fixedgc = NULL; 415 g->finobj = g->tobefnz = g->fixedgc = NULL;
416 g->survival = g->old1 = g->reallyold = NULL; 416 g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
417 g->finobjsur = g->finobjold1 = g->finobjrold = NULL; 417 g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
418 g->sweepgc = NULL; 418 g->sweepgc = NULL;
419 g->gray = g->grayagain = NULL; 419 g->gray = g->grayagain = NULL;