Example #1
0
static void traversestack (global_State *g, lua_State *l) {
  StkId o, lim;
  CallInfo *ci;
  markvalue(g, gt(l));
  lim = l->top;
  for (ci = l->base_ci; ci <= l->ci; ci++) {
    lua_assert(ci->top <= l->stack_last);
    if (lim < ci->top) lim = ci->top;
  }
  for (o = l->stack; o < l->top; o++)
    markvalue(g, o);
  for (; o <= lim; o++)
    setnilvalue(o);
  checkstacksizes(l, lim);
}
Example #2
0
static void traversestack (global_State *g, lua_State *l) {
  StkId o, lim;
  CallInfo *ci;
  markvalue(g, gt(l));
  lim = l->top;
  if(l->stack == NULL) return; /* no stack to traverse */
  for (ci = l->base_ci; ci <= l->ci; ci++) {
    lua_assert(ci->top <= l->stack_last);
    if (lim < ci->top) lim = ci->top;
  }
  for (o = l->stack; o < l->top; o++)
    markvalue(g, o);
  for (; o <= lim; o++)
    setnilvalue(o);
  if (!isfixedstack(l)) /* if stack size is fixed, can't resize it. */
    checkstacksizes(l, lim);
}
Example #3
0
static void traversestack (GCState *st, lua_State *L1) {
    StkId o, lim;
    CallInfo *ci;
    markobject(st, gt(L1));
    lim = L1->top;
    for (ci = L1->base_ci; ci <= L1->ci; ci++) {
        lua_assert(ci->top <= L1->stack_last);
        lua_assert(ci->state & (CI_C | CI_HASFRAME | CI_SAVEDPC));
        if (lim < ci->top)
            lim = ci->top;
    }
    for (o = L1->stack; o < L1->top; o++)
        markobject(st, o);
    for (; o <= lim; o++)
        setnilvalue(o);
    checkstacksizes(L1, lim);
}
Example #4
0
File: lgc.c Project: zapline/zlib
static void traversestack (global_State *g, lua_State *l) {
  StkId o, lim;
  CallInfo *ci;
  markvalue(g, gt(l));
  lim = l->top;
  for (ci = l->base_ci; ci <= l->ci; ci++) {
    lua_assert(ci->top <= l->stack_last);
    if (lim < ci->top) lim = ci->top;
  }
  for (o = l->stack; o < l->top; o++)
    markvalue(g, o);
#if LUA_REFCOUNT
  for (; o <= lim; o++) {
    if (iscollectable(o))
      o->value.gc->gch.ref--;
    setnilvalue2n(l, o);
  }
#else
  for (; o <= lim; o++)
    setnilvalue(o);
#endif /* LUA_REFCOUNT */
  checkstacksizes(l, lim);
}