Lines Matching +full:ts +full:- +full:inv

72   (x->marked = cast_byte((x->marked & ~maskcolors) | luaC_white(g)))
75 #define set2gray(x) resetbits(x->marked, maskcolors)
80 (x->marked = cast_byte((x->marked & ~WHITEBITS) | bitmask(BLACKBIT)))
94 #define markvalue(g,o) { checkliveness(g->mainthread,o); \
126 switch (o->tt) { in getgclist()
127 case LUA_VTABLE: return &gco2t(o)->gclist; in getgclist()
128 case LUA_VLCL: return &gco2lcl(o)->gclist; in getgclist()
129 case LUA_VCCL: return &gco2ccl(o)->gclist; in getgclist()
130 case LUA_VTHREAD: return &gco2th(o)->gclist; in getgclist()
131 case LUA_VPROTO: return &gco2p(o)->gclist; in getgclist()
134 lua_assert(u->nuvalue > 0); in getgclist()
135 return &u->gclist; in getgclist()
146 #define linkgclist(o,p) linkgclist_(obj2gco(o), &(o)->gclist, &(p))
180 ** table. Non-collectable objects are never removed from weak
186 if (o == NULL) return 0; /* non-collectable value */ in iscleared()
187 else if (novariant(o->tt) == LUA_TSTRING) { in iscleared()
199 ** be changed directly to OLD, because it may still point to non-old
220 if (g->gckind == KGC_INC) /* incremental mode? */ in luaC_barrier_()
233 lua_assert((g->gckind == KGC_GEN) == (isold(o) && getage(o) != G_TOUCHED1)); in luaC_barrierback_()
237 linkobjgclist(o, g->grayagain); in luaC_barrierback_()
245 lua_assert(g->allgc == o); /* object must be 1st in 'allgc' list! */ in luaC_fix()
248 g->allgc = o->next; /* remove object from 'allgc' list */ in luaC_fix()
249 o->next = g->fixedgc; /* link it to 'fixedgc' list */ in luaC_fix()
250 g->fixedgc = o; in luaC_fix()
262 o->marked = luaC_white(g); in luaC_newobjdt()
263 o->tt = tt; in luaC_newobjdt()
264 o->next = g->allgc; in luaC_newobjdt()
265 g->allgc = o; in luaC_newobjdt()
298 switch (o->tt) { in reallymarkobject()
310 markvalue(g, uv->v.p); /* mark its content */ in reallymarkobject()
315 if (u->nuvalue == 0) { /* no user values? */ in reallymarkobject()
316 markobjectN(g, u->metatable); /* mark its metatable */ in reallymarkobject()
324 linkobjgclist(o, g->gray); /* to be visited later */ in reallymarkobject()
338 markobjectN(g, g->mt[i]); in markmt()
343 ** mark all objects in list of being-finalized
348 for (o = g->tobefnz; o != NULL; o = o->next) { in markbeingfnz()
357 ** For each non-marked thread, simulates a barrier between each open
360 ** to act. The "barrier" does not need to check colors: A non-marked
369 lua_State **p = &g->twups; in remarkupvals()
373 if (!iswhite(thread) && thread->openupval != NULL) in remarkupvals()
374 p = &thread->twups; /* keep marked thread with upvalues in the list */ in remarkupvals()
377 lua_assert(!isold(thread) || thread->openupval == NULL); in remarkupvals()
378 *p = thread->twups; /* remove thread from the list */ in remarkupvals()
379 thread->twups = thread; /* mark that it is out of list */ in remarkupvals()
380 for (uv = thread->openupval; uv != NULL; uv = uv->u.open.next) { in remarkupvals()
385 markvalue(g, uv->v.p); /* mark its value */ in remarkupvals()
395 g->gray = g->grayagain = NULL; in cleargraylists()
396 g->weak = g->allweak = g->ephemeron = NULL; in cleargraylists()
405 markobject(g, g->mainthread); in restartcollection()
406 markvalue(g, &g->l_registry); in restartcollection()
423 ** post-processing by 'correctgraylist'. (It could put all old objects
433 linkobjgclist(o, g->grayagain); /* link it back in 'grayagain' */ in genlink()
450 int hasclears = (h->alimit > 0); in traverseweakvalue()
461 if (g->gcstate == GCSatomic && hasclears) in traverseweakvalue()
462 linkgclist(h, g->weak); /* has to be cleared later */ in traverseweakvalue()
464 linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */ in traverseweakvalue()
473 ** the atomic phase, if table has any white->white entry, it has to
477 ** must be kept in some gray list for post-processing; this is done
480 static int traverseephemeron (global_State *g, Table *h, int inv) { in traverseephemeron() argument
483 int hasww = 0; /* true if table has entry "white-key -> white-value" */ in traverseephemeron()
489 if (valiswhite(&h->array[i])) { in traverseephemeron()
491 reallymarkobject(g, gcvalue(&h->array[i])); in traverseephemeron()
494 /* traverse hash part; if 'inv', traverse descending in traverseephemeron()
497 Node *n = inv ? gnode(h, nsize - 1 - i) : gnode(h, i); in traverseephemeron()
503 hasww = 1; /* white-white entry */ in traverseephemeron()
511 if (g->gcstate == GCSpropagate) in traverseephemeron()
512 linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */ in traverseephemeron()
513 else if (hasww) /* table has white->white entries? */ in traverseephemeron()
514 linkgclist(h, g->ephemeron); /* have to propagate again */ in traverseephemeron()
516 linkgclist(h, g->allweak); /* may have to clean white keys */ in traverseephemeron()
528 markvalue(g, &h->array[i]); in traversestrongtable()
544 const TValue *mode = gfasttm(g, h->metatable, TM_MODE); in traversetable()
546 markobjectN(g, h->metatable); in traversetable()
557 linkgclist(h, g->allweak); /* nothing to traverse now */ in traversetable()
561 return 1 + h->alimit + 2 * allocsizenode(h); in traversetable()
567 markobjectN(g, u->metatable); /* mark its metatable */ in traverseudata()
568 for (i = 0; i < u->nuvalue; i++) in traverseudata()
569 markvalue(g, &u->uv[i].uv); in traverseudata()
571 return 1 + u->nuvalue; in traverseudata()
582 markobjectN(g, f->source); in traverseproto()
583 for (i = 0; i < f->sizek; i++) /* mark literals */ in traverseproto()
584 markvalue(g, &f->k[i]); in traverseproto()
585 for (i = 0; i < f->sizeupvalues; i++) /* mark upvalue names */ in traverseproto()
586 markobjectN(g, f->upvalues[i].name); in traverseproto()
587 for (i = 0; i < f->sizep; i++) /* mark nested protos */ in traverseproto()
588 markobjectN(g, f->p[i]); in traverseproto()
589 for (i = 0; i < f->sizelocvars; i++) /* mark local-variable names */ in traverseproto()
590 markobjectN(g, f->locvars[i].varname); in traverseproto()
591 return 1 + f->sizek + f->sizeupvalues + f->sizep + f->sizelocvars; in traverseproto()
597 for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ in traverseCclosure()
598 markvalue(g, &cl->upvalue[i]); in traverseCclosure()
599 return 1 + cl->nupvalues; in traverseCclosure()
608 markobjectN(g, cl->p); /* mark its prototype */ in traverseLclosure()
609 for (i = 0; i < cl->nupvalues; i++) { /* visit its upvalues */ in traverseLclosure()
610 UpVal *uv = cl->upvals[i]; in traverseLclosure()
613 return 1 + cl->nupvalues; in traverseLclosure()
620 ** ensures that the entire stack have valid (non-dead) objects.
631 StkId o = th->stack.p; in traversethread()
632 if (isold(th) || g->gcstate == GCSpropagate) in traversethread()
633 linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ in traversethread()
636 lua_assert(g->gcstate == GCSatomic || in traversethread()
637 th->openupval == NULL || isintwups(th)); in traversethread()
638 for (; o < th->top.p; o++) /* mark live elements in the stack */ in traversethread()
640 for (uv = th->openupval; uv != NULL; uv = uv->u.open.next) in traversethread()
642 if (g->gcstate == GCSatomic) { /* final traversal? */ in traversethread()
643 if (!g->gcemergency) in traversethread()
645 for (o = th->top.p; o < th->stack_last.p + EXTRA_STACK; o++) in traversethread()
648 if (!isintwups(th) && th->openupval != NULL) { in traversethread()
649 th->twups = g->twups; /* link it back to the list */ in traversethread()
650 g->twups = th; in traversethread()
661 GCObject *o = g->gray; in propagatemark()
663 g->gray = *getgclist(o); /* remove from 'gray' list */ in propagatemark()
664 switch (o->tt) { in propagatemark()
678 while (g->gray) in propagateall()
696 GCObject *next = g->ephemeron; /* get ephemeron list */ in convergeephemerons()
697 g->ephemeron = NULL; /* tables may return to this list when traversed */ in convergeephemerons()
701 next = h->gclist; /* list is rebuilt during loop */ in convergeephemerons()
726 for (; l; l = gco2t(l)->gclist) { in clearbykeys()
745 for (; l != f; l = gco2t(l)->gclist) { in clearbyvalues()
751 TValue *o = &h->array[i]; in clearbyvalues()
773 switch (o->tt) { in freeobj()
782 luaM_freemem(L, cl, sizeLclosure(cl->nupvalues)); in freeobj()
787 luaM_freemem(L, cl, sizeCclosure(cl->nupvalues)); in freeobj()
798 luaM_freemem(L, o, sizeudata(u->nuvalue, u->len)); in freeobj()
802 TString *ts = gco2ts(o); in freeobj() local
803 luaS_remove(L, ts); /* remove it from hash table */ in freeobj()
804 luaM_freemem(L, ts, sizelstring(ts->shrlen)); in freeobj()
808 TString *ts = gco2ts(o); in freeobj() local
809 luaM_freemem(L, ts, sizelstring(ts->u.lnglen)); in freeobj()
820 ** white; change all non-dead objects back to white, preparing for next
832 int marked = curr->marked; in sweeplist()
834 *p = curr->next; /* remove 'curr' from list */ in sweeplist()
838 curr->marked = cast_byte((marked & ~maskgcbits) | white); in sweeplist()
839 p = &curr->next; /* go to next element */ in sweeplist()
872 if (!g->gcemergency) { in checkSizes()
873 if (g->strt.nuse < g->strt.size / 4) { /* string table too big? */ in checkSizes()
874 l_mem olddebt = g->GCdebt; in checkSizes()
875 luaS_resize(L, g->strt.size / 2); in checkSizes()
876 g->GCestimate += g->GCdebt - olddebt; /* correct estimate */ in checkSizes()
887 GCObject *o = g->tobefnz; /* get first element */ in udata2finalize()
889 g->tobefnz = o->next; /* remove it from 'tobefnz' list */ in udata2finalize()
890 o->next = g->allgc; /* return it to 'allgc' list */ in udata2finalize()
891 g->allgc = o; in udata2finalize()
892 resetbit(o->marked, FINALIZEDBIT); /* object is "normal" again */ in udata2finalize()
896 g->firstold1 = o; /* it is the first OLD1 object in the list */ in udata2finalize()
903 luaD_callnoyield(L, L->top.p - 2, 0); in dothecall()
911 lua_assert(!g->gcemergency); in GCTM()
916 lu_byte oldah = L->allowhook; in GCTM()
917 int oldgcstp = g->gcstp; in GCTM()
918 g->gcstp |= GCSTPGC; /* avoid GC steps */ in GCTM()
919 L->allowhook = 0; /* stop debug hooks during GC metamethod */ in GCTM()
920 setobj2s(L, L->top.p++, tm); /* push finalizer... */ in GCTM()
921 setobj2s(L, L->top.p++, &v); /* ... and its argument */ in GCTM()
922 L->ci->callstatus |= CIST_FIN; /* will run a finalizer */ in GCTM()
923 status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top.p - 2), 0); in GCTM()
924 L->ci->callstatus &= ~CIST_FIN; /* not running a finalizer anymore */ in GCTM()
925 L->allowhook = oldah; /* restore hooks */ in GCTM()
926 g->gcstp = oldgcstp; /* restore state */ in GCTM()
929 L->top.p--; /* pops error object */ in GCTM()
941 for (i = 0; i < n && g->tobefnz; i++) in runafewfinalizers()
952 while (g->tobefnz) in callallpendingfinalizers()
962 p = &(*p)->next; in findlast()
976 GCObject **p = &g->finobj; in separatetobefnz()
977 GCObject **lastnext = findlast(&g->tobefnz); in separatetobefnz()
978 while ((curr = *p) != g->finobjold1) { /* traverse all finalizable objects */ in separatetobefnz()
981 p = &curr->next; /* don't bother with it */ in separatetobefnz()
983 if (curr == g->finobjsur) /* removing 'finobjsur'? */ in separatetobefnz()
984 g->finobjsur = curr->next; /* correct it */ in separatetobefnz()
985 *p = curr->next; /* remove 'curr' from 'finobj' list */ in separatetobefnz()
986 curr->next = *lastnext; /* link at the end of 'tobefnz' list */ in separatetobefnz()
988 lastnext = &curr->next; in separatetobefnz()
999 *p = o->next; in checkpointer()
1008 checkpointer(&g->survival, o); in correctpointers()
1009 checkpointer(&g->old1, o); in correctpointers()
1010 checkpointer(&g->reallyold, o); in correctpointers()
1011 checkpointer(&g->firstold1, o); in correctpointers()
1023 (g->gcstp & GCSTPCLS)) /* or closing state? */ in luaC_checkfinalizer()
1029 if (g->sweepgc == &o->next) /* should not remove 'sweepgc' object */ in luaC_checkfinalizer()
1030 g->sweepgc = sweeptolive(L, g->sweepgc); /* change 'sweepgc' */ in luaC_checkfinalizer()
1035 for (p = &g->allgc; *p != o; p = &(*p)->next) { /* empty */ } in luaC_checkfinalizer()
1036 *p = o->next; /* remove 'o' from 'allgc' list */ in luaC_checkfinalizer()
1037 o->next = g->finobj; /* link it in 'finobj' list */ in luaC_checkfinalizer()
1038 g->finobj = o; in luaC_checkfinalizer()
1039 l_setbit(o->marked, FINALIZEDBIT); /* mark it as such */ in luaC_checkfinalizer()
1061 int pause = getgcparam(g->gcpause); in setpause()
1062 l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ in setpause()
1067 debt = gettotalbytes(g) - threshold; in setpause()
1075 ** objects and turns the non dead to old. All non-dead threads---which
1076 ** are now old---must be in a gray list. Everything else is not in a
1085 *p = curr->next; /* remove 'curr' from list */ in sweep2old()
1090 if (curr->tt == LUA_VTHREAD) { /* threads must be watched */ in sweep2old()
1092 linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ in sweep2old()
1094 else if (curr->tt == LUA_VUPVAL && upisopen(gco2upv(curr))) in sweep2old()
1098 p = &curr->next; /* go to next element */ in sweep2old()
1108 ** non-dead objects, advance their ages and clear the color of
1111 ** here, because these old-generation objects are usually not swept
1131 *p = curr->next; /* remove 'curr' from list */ in sweepgen()
1136 int marked = curr->marked & ~maskgcbits; /* erase GC bits */ in sweepgen()
1137 curr->marked = cast_byte(marked | G_SURVIVAL | white); in sweepgen()
1144 p = &curr->next; /* go to next element */ in sweepgen()
1158 for (; p != NULL; p = p->next) in whitelist()
1159 p->marked = cast_byte((p->marked & ~maskgcbits) | white); in whitelist()
1169 ** Non-white threads also remain on the list; 'TOUCHED2' objects become
1184 else if (curr->tt == LUA_VTHREAD) { in correctgraylist()
1186 goto remain; /* keep non-white threads on the list */ in correctgraylist()
1206 GCObject **list = correctgraylist(&g->grayagain); in correctgraylists()
1207 *list = g->weak; g->weak = NULL; in correctgraylists()
1209 *list = g->allweak; g->allweak = NULL; in correctgraylists()
1211 *list = g->ephemeron; g->ephemeron = NULL; in correctgraylists()
1223 for (p = from; p != to; p = p->next) { in markold()
1235 ** Finish a young-generation collection.
1240 g->gcstate = GCSpropagate; /* skip restart */ in finishgencycle()
1241 if (!g->gcemergency) in finishgencycle()
1252 GCObject **psurvival; /* to point to first non-dead survival object */ in youngcollection()
1254 lua_assert(g->gcstate == GCSpropagate); in youngcollection()
1255 if (g->firstold1) { /* are there regular OLD1 objects? */ in youngcollection()
1256 markold(g, g->firstold1, g->reallyold); /* mark them */ in youngcollection()
1257 g->firstold1 = NULL; /* no more OLD1 objects (for now) */ in youngcollection()
1259 markold(g, g->finobj, g->finobjrold); in youngcollection()
1260 markold(g, g->tobefnz, NULL); in youngcollection()
1264 g->gcstate = GCSswpallgc; in youngcollection()
1265 psurvival = sweepgen(L, g, &g->allgc, g->survival, &g->firstold1); in youngcollection()
1267 sweepgen(L, g, psurvival, g->old1, &g->firstold1); in youngcollection()
1268 g->reallyold = g->old1; in youngcollection()
1269 g->old1 = *psurvival; /* 'survival' survivals are old now */ in youngcollection()
1270 g->survival = g->allgc; /* all news are survivals */ in youngcollection()
1274 psurvival = sweepgen(L, g, &g->finobj, g->finobjsur, &dummy); in youngcollection()
1276 sweepgen(L, g, psurvival, g->finobjold1, &dummy); in youngcollection()
1277 g->finobjrold = g->finobjold1; in youngcollection()
1278 g->finobjold1 = *psurvival; /* 'survival' survivals are old now */ in youngcollection()
1279 g->finobjsur = g->finobj; /* all news are survivals */ in youngcollection()
1281 sweepgen(L, g, &g->tobefnz, NULL, &dummy); in youngcollection()
1295 g->gcstate = GCSswpallgc; in atomic2gen()
1296 sweep2old(L, &g->allgc); in atomic2gen()
1298 g->reallyold = g->old1 = g->survival = g->allgc; in atomic2gen()
1299 g->firstold1 = NULL; /* there are no OLD1 objects anywhere */ in atomic2gen()
1302 sweep2old(L, &g->finobj); in atomic2gen()
1303 g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj; in atomic2gen()
1305 sweep2old(L, &g->tobefnz); in atomic2gen()
1307 g->gckind = KGC_GEN; in atomic2gen()
1308 g->lastatomic = 0; in atomic2gen()
1309 g->GCestimate = gettotalbytes(g); /* base for memory control */ in atomic2gen()
1319 luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul)); in setminordebt()
1346 whitelist(g, g->allgc); in enterinc()
1347 g->reallyold = g->old1 = g->survival = NULL; in enterinc()
1348 whitelist(g, g->finobj); in enterinc()
1349 whitelist(g, g->tobefnz); in enterinc()
1350 g->finobjrold = g->finobjold1 = g->finobjsur = NULL; in enterinc()
1351 g->gcstate = GCSpause; in enterinc()
1352 g->gckind = KGC_INC; in enterinc()
1353 g->lastatomic = 0; in enterinc()
1362 if (newmode != g->gckind) { in luaC_changemode()
1368 g->lastatomic = 0; in luaC_changemode()
1399 ** field 'g->lastatomic' keeps this count from the last collection.
1400 ** ('g->lastatomic != 0' also means that the last collection was bad.)
1404 lu_mem lastatomic = g->lastatomic; /* count from last collection */ in stepgenfull()
1405 if (g->gckind == KGC_GEN) /* still in generational mode? */ in stepgenfull()
1414 g->GCestimate = gettotalbytes(g); /* first estimate */ in stepgenfull()
1418 g->lastatomic = newatomic; in stepgenfull()
1430 ** in 'g->GCestimate'), the function does a major collection. At the
1436 ** 'g->lastatomic' to signal that fact, so that the next collection will
1443 if (g->lastatomic != 0) /* last collection was a bad one? */ in genstep()
1446 lu_mem majorbase = g->GCestimate; /* memory after last major collection */ in genstep()
1447 lu_mem majorinc = (majorbase / 100) * getgcparam(g->genmajormul); in genstep()
1448 if (g->GCdebt > 0 && gettotalbytes(g) > majorbase + majorinc) { in genstep()
1453 lua_assert(g->lastatomic == 0); in genstep()
1456 g->lastatomic = numobjs; /* signal that last collection was bad */ in genstep()
1463 g->GCestimate = majorbase; /* preserve base value */ in genstep()
1488 g->gcstate = GCSswpallgc; in entersweep()
1489 lua_assert(g->sweepgc == NULL); in entersweep()
1490 g->sweepgc = sweeptolive(L, &g->allgc); in entersweep()
1500 GCObject *next = p->next; in deletelist()
1513 g->gcstp = GCSTPCLS; /* no extra finalizers after here */ in luaC_freeallobjects()
1516 lua_assert(g->finobj == NULL); in luaC_freeallobjects()
1518 deletelist(L, g->allgc, obj2gco(g->mainthread)); in luaC_freeallobjects()
1519 lua_assert(g->finobj == NULL); /* no new finalizers */ in luaC_freeallobjects()
1520 deletelist(L, g->fixedgc, NULL); /* collect fixed objects */ in luaC_freeallobjects()
1521 lua_assert(g->strt.nuse == 0); in luaC_freeallobjects()
1529 GCObject *grayagain = g->grayagain; /* save original list */ in atomic()
1530 g->grayagain = NULL; in atomic()
1531 lua_assert(g->ephemeron == NULL && g->weak == NULL); in atomic()
1532 lua_assert(!iswhite(g->mainthread)); in atomic()
1533 g->gcstate = GCSatomic; in atomic()
1536 markvalue(g, &g->l_registry); in atomic()
1542 g->gray = grayagain; in atomic()
1547 clearbyvalues(g, g->weak, NULL); in atomic()
1548 clearbyvalues(g, g->allweak, NULL); in atomic()
1549 origweak = g->weak; origall = g->allweak; in atomic()
1556 clearbykeys(g, g->ephemeron); /* clear keys from all ephemeron tables */ in atomic()
1557 clearbykeys(g, g->allweak); /* clear keys from all 'allweak' tables */ in atomic()
1559 clearbyvalues(g, g->weak, origweak); in atomic()
1560 clearbyvalues(g, g->allweak, origall); in atomic()
1562 g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */ in atomic()
1563 lua_assert(g->gray == NULL); in atomic()
1570 if (g->sweepgc) { in sweepstep()
1571 l_mem olddebt = g->GCdebt; in sweepstep()
1573 g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX, &count); in sweepstep()
1574 g->GCestimate += g->GCdebt - olddebt; /* update estimate */ in sweepstep()
1578 g->gcstate = nextstate; in sweepstep()
1579 g->sweepgc = nextlist; in sweepstep()
1588 lua_assert(!g->gcstopem); /* collector is not reentrant */ in singlestep()
1589 g->gcstopem = 1; /* no emergency collections while collecting */ in singlestep()
1590 switch (g->gcstate) { in singlestep()
1593 g->gcstate = GCSpropagate; in singlestep()
1598 if (g->gray == NULL) { /* no more gray objects? */ in singlestep()
1599 g->gcstate = GCSenteratomic; /* finish propagate phase */ in singlestep()
1609 g->GCestimate = gettotalbytes(g); /* first estimate */ in singlestep()
1613 work = sweepstep(L, g, GCSswpfinobj, &g->finobj); in singlestep()
1617 work = sweepstep(L, g, GCSswptobefnz, &g->tobefnz); in singlestep()
1626 g->gcstate = GCScallfin; in singlestep()
1631 if (g->tobefnz && !g->gcemergency) { in singlestep()
1632 g->gcstopem = 0; /* ok collections during finalizers */ in singlestep()
1636 g->gcstate = GCSpause; /* finish collection */ in singlestep()
1643 g->gcstopem = 0; in singlestep()
1654 while (!testbit(statesmask, g->gcstate)) in luaC_runtilstate()
1668 int stepmul = (getgcparam(g->gcstepmul) | 1); /* avoid division by 0 */ in incstep()
1669 l_mem debt = (g->GCdebt / WORK2MEM) * stepmul; in incstep()
1670 l_mem stepsize = (g->gcstepsize <= log2maxs(l_mem)) in incstep()
1671 ? ((cast(l_mem, 1) << g->gcstepsize) / WORK2MEM) * stepmul in incstep()
1675 debt -= work; in incstep()
1676 } while (debt > -stepsize && g->gcstate != GCSpause); in incstep()
1677 if (g->gcstate == GCSpause) in incstep()
1693 luaE_setdebt(g, -2000); in luaC_step()
1716 g->gcstate = GCSenteratomic; /* go straight to atomic phase */ in fullinc()
1719 lua_assert(g->GCestimate == gettotalbytes(g)); in fullinc()
1732 lua_assert(!g->gcemergency); in luaC_fullgc()
1733 g->gcemergency = isemergency; /* set flag */ in luaC_fullgc()
1734 if (g->gckind == KGC_INC) in luaC_fullgc()
1738 g->gcemergency = 0; in luaC_fullgc()