/* sweep a list until a live object (or end of list)  */
static GCObject** sweeptolive(lua_State *L, GCObject **p, int *n)
/* sweep a list until a live object (or end of list)  */
static GCObject** sweeptolive(lua_State *L, GCObject **p, int *n)
{
    i++;
    p = sweeplist(L, p, 1);
  } while (p == old);
  if (n) *n += i;
  return p;
}