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

Function clearvalues

third-party/lua-5.2.4/src/lgc.c:643–660  ·  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

641** to element 'f'
642*/
643static void clearvalues (global_State *g, GCObject *l, GCObject *f) {
644 for (; l != f; l = gco2t(l)->gclist) {
645 Table *h = gco2t(l);
646 Node *n, *limit = gnodelast(h);
647 int i;
648 for (i = 0; i < h->sizearray; i++) {
649 TValue *o = &h->array[i];
650 if (iscleared(g, o)) /* value was collected? */
651 setnilvalue(o); /* remove value */
652 }
653 for (n = gnode(h, 0); n < limit; n++) {
654 if (!ttisnil(gval(n)) && iscleared(g, gval(n))) {
655 setnilvalue(gval(n)); /* remove value ... */
656 removeentry(n); /* and remove entry from table */
657 }
658 }
659 }
660}
661
662
663static void freeobj (lua_State *L, GCObject *o) {

Callers 1

atomicFunction · 0.70

Calls 2

isclearedFunction · 0.70
removeentryFunction · 0.70

Tested by

no test coverage detected