| 203 | |
| 204 | |
| 205 | void luaD_shrinkstack (lua_State *L) { |
| 206 | int inuse = stackinuse(L); |
| 207 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; |
| 208 | if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; |
| 209 | if (inuse > LUAI_MAXSTACK || /* handling stack overflow? */ |
| 210 | goodsize >= L->stacksize) /* would grow instead of shrink? */ |
| 211 | condmovestack(L); /* don't change stack (change only for debugging) */ |
| 212 | else |
| 213 | luaD_reallocstack(L, goodsize); /* shrink it */ |
| 214 | } |
| 215 | |
| 216 | |
| 217 | void luaD_hook (lua_State *L, int event, int line) { |
no test coverage detected