MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / clearbykeys

Function clearbykeys

extlibs/lua/src/lgc.c:664–676  ·  view source on GitHub ↗

** clear entries with unmarked keys from all weaktables in list 'l' */

Source from the content-addressed store, hash-verified

662** clear entries with unmarked keys from all weaktables in list 'l'
663*/
664static void clearbykeys (global_State *g, GCObject *l) {
665 for (; l; l = gco2t(l)->gclist) {
666 Table *h = gco2t(l);
667 Node *limit = gnodelast(h);
668 Node *n;
669 for (n = gnode(h, 0); n < limit; n++) {
670 if (iscleared(g, gckeyN(n))) /* unmarked key? */
671 setempty(gval(n)); /* remove entry */
672 if (isempty(gval(n))) /* is entry empty? */
673 clearkey(n); /* clear its key */
674 }
675 }
676}
677
678
679/*

Callers 1

atomicFunction · 0.85

Calls 2

isclearedFunction · 0.85
clearkeyFunction · 0.85

Tested by

no test coverage detected