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

Function traversestack

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

Source from the content-addressed store, hash-verified

492
493
494static lu_mem traversestack (global_State *g, lua_State *th) {
495 int n = 0;
496 StkId o = th->stack;
497 if (o == NULL)
498 return 1; /* stack not completely built yet */
499 for (; o < th->top; o++) /* mark live elements in the stack */
500 markvalue(g, o);
501 if (g->gcstate == GCSatomic) { /* final traversal? */
502 StkId lim = th->stack + th->stacksize; /* real end of stack */
503 for (; o < lim; o++) /* clear not-marked stack slice */
504 setnilvalue(o);
505 }
506 else { /* count call infos to compute size */
507 CallInfo *ci;
508 for (ci = &th->base_ci; ci != th->ci; ci = ci->next)
509 n++;
510 }
511 return sizeof(lua_State) + sizeof(TValue) * th->stacksize +
512 sizeof(CallInfo) * n;
513}
514
515
516/*

Callers 1

propagatemarkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected