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

Function clearvalues

freebsd/contrib/openzfs/module/lua/lgc.c:642–659  ·  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

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

Callers 1

atomicFunction · 0.85

Calls 2

isclearedFunction · 0.70
removeentryFunction · 0.70

Tested by

no test coverage detected