MCPcopy Create free account
hub / github.com/F-Stack/f-stack / propagatemark

Function propagatemark

freebsd/contrib/openzfs/module/lua/lgc.c:520–562  ·  view source on GitHub ↗

** traverse one gray object, turning it to black (except for threads, ** which are always gray). */

Source from the content-addressed store, hash-verified

518** which are always gray).
519*/
520static void propagatemark (global_State *g) {
521 lu_mem size;
522 GCObject *o = g->gray;
523 lua_assert(isgray(o));
524 gray2black(o);
525 switch (gch(o)->tt) {
526 case LUA_TTABLE: {
527 Table *h = gco2t(o);
528 g->gray = h->gclist; /* remove from 'gray' list */
529 size = traversetable(g, h);
530 break;
531 }
532 case LUA_TLCL: {
533 LClosure *cl = gco2lcl(o);
534 g->gray = cl->gclist; /* remove from 'gray' list */
535 size = traverseLclosure(g, cl);
536 break;
537 }
538 case LUA_TCCL: {
539 CClosure *cl = gco2ccl(o);
540 g->gray = cl->gclist; /* remove from 'gray' list */
541 size = traverseCclosure(g, cl);
542 break;
543 }
544 case LUA_TTHREAD: {
545 lua_State *th = gco2th(o);
546 g->gray = th->gclist; /* remove from 'gray' list */
547 th->gclist = g->grayagain;
548 g->grayagain = o; /* insert into 'grayagain' list */
549 black2gray(o);
550 size = traversestack(g, th);
551 break;
552 }
553 case LUA_TPROTO: {
554 Proto *p = gco2p(o);
555 g->gray = p->gclist; /* remove from 'gray' list */
556 size = traverseproto(g, p);
557 break;
558 }
559 default: lua_assert(0); return;
560 }
561 g->GCmemtrav += size;
562}
563
564
565static void propagateall (global_State *g) {

Callers 2

propagateallFunction · 0.70
singlestepFunction · 0.70

Calls 5

traverseLclosureFunction · 0.85
traverseCclosureFunction · 0.85
traversetableFunction · 0.70
traversestackFunction · 0.70
traverseprotoFunction · 0.70

Tested by

no test coverage detected