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

Function clearbyvalues

extlibs/lua/src/lgc.c:683–701  ·  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

681** to element 'f'
682*/
683static void clearbyvalues (global_State *g, GCObject *l, GCObject *f) {
684 for (; l != f; l = gco2t(l)->gclist) {
685 Table *h = gco2t(l);
686 Node *n, *limit = gnodelast(h);
687 unsigned int i;
688 unsigned int asize = luaH_realasize(h);
689 for (i = 0; i < asize; i++) {
690 TValue *o = &h->array[i];
691 if (iscleared(g, gcvalueN(o))) /* value was collected? */
692 setempty(o); /* remove entry */
693 }
694 for (n = gnode(h, 0); n < limit; n++) {
695 if (iscleared(g, gcvalueN(gval(n)))) /* unmarked value? */
696 setempty(gval(n)); /* remove entry */
697 if (isempty(gval(n))) /* is entry empty? */
698 clearkey(n); /* clear its key */
699 }
700 }
701}
702
703
704static void freeupval (lua_State *L, UpVal *uv) {

Callers 1

atomicFunction · 0.85

Calls 3

luaH_realasizeFunction · 0.85
isclearedFunction · 0.85
clearkeyFunction · 0.85

Tested by

no test coverage detected