MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / clearbykeys

Function clearbykeys

3rd/lua-5.4.3/src/lgc.c:717–729  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

715** clear entries with unmarked keys from all weaktables in list 'l'
716*/
717static void clearbykeys (global_State *g, GCObject *l) {
718 for (; l; l = gco2t(l)->gclist) {
719 Table *h = gco2t(l);
720 Node *limit = gnodelast(h);
721 Node *n;
722 for (n = gnode(h, 0); n < limit; n++) {
723 if (iscleared(g, gckeyN(n))) /* unmarked key? */
724 setempty(gval(n)); /* remove entry */
725 if (isempty(gval(n))) /* is entry empty? */
726 clearkey(n); /* clear its key */
727 }
728 }
729}
730
731
732/*

Callers 1

atomicFunction · 0.85

Calls 2

isclearedFunction · 0.85
clearkeyFunction · 0.85

Tested by

no test coverage detected