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

Function clearbyvalues

third-party/lua-5.5.0/src/lgc.c:808–826  ·  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

806** to element 'f'
807*/
808static void clearbyvalues (global_State *g, GCObject *l, GCObject *f) {
809 for (; l != f; l = gco2t(l)->gclist) {
810 Table *h = gco2t(l);
811 Node *n, *limit = gnodelast(h);
812 unsigned int i;
813 unsigned int asize = h->asize;
814 for (i = 0; i < asize; i++) {
815 GCObject *o = gcvalarr(h, i);
816 if (iscleared(g, o)) /* value was collected? */
817 *getArrTag(h, i) = LUA_VEMPTY; /* remove entry */
818 }
819 for (n = gnode(h, 0); n < limit; n++) {
820 if (iscleared(g, gcvalueN(gval(n)))) /* unmarked value? */
821 setempty(gval(n)); /* remove entry */
822 if (isempty(gval(n))) /* is entry empty? */
823 clearkey(n); /* clear its key */
824 }
825 }
826}
827
828
829static void freeupval (lua_State *L, UpVal *uv) {

Callers 1

atomicFunction · 0.70

Calls 2

isclearedFunction · 0.70
clearkeyFunction · 0.70

Tested by

no test coverage detected