/* Traverse all ephemeron tables propagating marks from keys to values. Repeat until it converges, that is, nothing new is marked. 'dir' inverts the direction of the traversals, trying to speed up convergence on chains in the same table.  */
static void convergeephemerons(global_State *g)
/* Traverse all ephemeron tables propagating marks from keys to values. Repeat until it converges, that is, nothing new is marked. 'dir' inverts the direction of the traversals, trying to speed up convergence on chains in the same table.  */
static void convergeephemerons(global_State *g)
{
    GCObject *w;
    GCObject *next = g->ephemeron;
    g->ephemeron = NULL;
    changed = 0;
    while ((w = next) != NULL) {
      Table *h = gco2t(w);
      next = h->gclist;
      nw2black(h);
      if (traverseephemeron(g, h, dir)) {
        propagateall(g);
        changed = 1;
      }
    }
    dir = !dir;
  } while (changed);
}