MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / traverseproto

Function traverseproto

third-party/lua-5.2.4/src/lgc.c:457–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455
456
457static int traverseproto (global_State *g, Proto *f) {
458 int i;
459 if (f->cache && iswhite(obj2gco(f->cache)))
460 f->cache = NULL; /* allow cache to be collected */
461 markobject(g, f->source);
462 for (i = 0; i < f->sizek; i++) /* mark literals */
463 markvalue(g, &f->k[i]);
464 for (i = 0; i < f->sizeupvalues; i++) /* mark upvalue names */
465 markobject(g, f->upvalues[i].name);
466 for (i = 0; i < f->sizep; i++) /* mark nested protos */
467 markobject(g, f->p[i]);
468 for (i = 0; i < f->sizelocvars; i++) /* mark local-variable names */
469 markobject(g, f->locvars[i].varname);
470 return sizeof(Proto) + sizeof(Instruction) * f->sizecode +
471 sizeof(Proto *) * f->sizep +
472 sizeof(TValue) * f->sizek +
473 sizeof(int) * f->sizelineinfo +
474 sizeof(LocVar) * f->sizelocvars +
475 sizeof(Upvaldesc) * f->sizeupvalues;
476}
477
478
479static lu_mem traverseCclosure (global_State *g, CClosure *cl) {

Callers 1

propagatemarkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected