MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / sweeplist

Function sweeplist

Source/Misc/lua/src/lua.c:6409–6430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6407
6408
6409static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
6410GCObject *curr;
6411global_State *g = G(L);
6412int deadmask = otherwhite(g);
6413while ((curr = *p) != NULL && count-- > 0) {
6414if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */
6415sweepwholelist(L, &gco2th(curr)->openupval);
6416if ((curr->gch.marked ^ WHITEBITS) & deadmask) { /* not dead? */
6417lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT));
6418makewhite(g, curr); /* make it white (for next cycle) */
6419p = &curr->gch.next;
6420}
6421else { /* must erase `curr' */
6422lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT));
6423*p = curr->gch.next;
6424if (curr == g->rootgc) /* is the first element of the list? */
6425g->rootgc = curr->gch.next; /* adjust first */
6426freeobj(L, curr);
6427}
6428}
6429return p;
6430}
6431
6432
6433static void checkSizes (lua_State *L) {

Callers 1

singlestepFunction · 0.85

Calls 1

freeobjFunction · 0.85

Tested by

no test coverage detected