| 273 | |
| 274 | |
| 275 | void luaD_shrinkstack (lua_State *L) { |
| 276 | int inuse = stackinuse(L); |
| 277 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; |
| 278 | if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; |
| 279 | if (inuse > LUAI_MAXSTACK || /* handling stack overflow? */ |
| 280 | goodsize >= L->stacksize) /* would grow instead of shrink? */ |
| 281 | condmovestack(L); /* don't change stack (change only for debugging) */ |
| 282 | else |
| 283 | luaD_reallocstack(L, goodsize); /* shrink it */ |
| 284 | } |
| 285 | |
| 286 | |
| 287 | void luaD_hook (lua_State *L, int event, int line) { |
no test coverage detected