| 248 | |
| 249 | |
| 250 | void luaD_shrinkstack(lua_State *L) { |
| 251 | int inuse = stackinuse(L); |
| 252 | int goodsize = inuse + (inuse / 8) + 2 * EXTRA_STACK; |
| 253 | if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; |
| 254 | if (L->stacksize > LUAI_MAXSTACK) /* was handling stack overflow? */ |
| 255 | luaE_freeCI(L); /* free all CIs (list grew because of an error) */ |
| 256 | else |
| 257 | luaE_shrinkCI(L); /* shrink list */ |
| 258 | if (inuse <= LUAI_MAXSTACK && /* not handling stack overflow? */ |
| 259 | goodsize < L->stacksize) /* trying to shrink? */ |
| 260 | luaD_reallocstack(L, goodsize); /* shrink it */ |
| 261 | else |
| 262 | condmovestack(L, , ); /* don't change stack (change only for debugging) */ |
| 263 | } |
| 264 | |
| 265 | |
| 266 | void luaD_inctop(lua_State *L) { |
no test coverage detected