/* clear entries with unmarked values from all weaktables in list 'l' up to element 'f'  */
static void clearbyvalues(global_State *g, GCObject *l, GCObject *f)
/* clear entries with unmarked values from all weaktables in list 'l' up to element 'f'  */
static void clearbyvalues(global_State *g, GCObject *l, GCObject *f)
{
    Table *h = gco2t(l);
    Node *n, *limit = gnodelast(h);
    unsigned int i;
    unsigned int asize = luaH_realasize(h);
    for (i = 0; i < asize; i++) {
      TValue *o = &h->array[i];
      if (iscleared(g, gcvalueN(o)))
        setempty(o);
    }
    for (n = gnode(h, 0); n < limit; n++) {
      if (iscleared(g, gcvalueN(gval(n))))
        setempty(gval(n));
      if (isempty(gval(n)))
        clearkey(n);
    }
  }
}