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

Function clearvalues

third-party/lua-5.3.5/src/lgc.c:658–675  ·  view source on GitHub ↗

** clear entries with unmarked values from all weaktables in list 'l' up ** to element 'f' */

Source from the content-addressed store, hash-verified

656** to element 'f'
657*/
658static void clearvalues (global_State *g, GCObject *l, GCObject *f) {
659 for (; l != f; l = gco2t(l)->gclist) {
660 Table *h = gco2t(l);
661 Node *n, *limit = gnodelast(h);
662 unsigned int i;
663 for (i = 0; i < h->sizearray; i++) {
664 TValue *o = &h->array[i];
665 if (iscleared(g, o)) /* value was collected? */
666 setnilvalue(o); /* remove value */
667 }
668 for (n = gnode(h, 0); n < limit; n++) {
669 if (!ttisnil(gval(n)) && iscleared(g, gval(n))) {
670 setnilvalue(gval(n)); /* remove value ... */
671 removeentry(n); /* and remove entry from table */
672 }
673 }
674 }
675}
676
677
678void luaC_upvdeccount (lua_State *L, UpVal *uv) {

Callers 1

atomicFunction · 0.70

Calls 2

isclearedFunction · 0.70
removeentryFunction · 0.70

Tested by

no test coverage detected