MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaD_shrinkstack

Function luaD_shrinkstack

third-party/lua-5.2.4/src/ldo.c:205–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205void 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
217void luaD_hook (lua_State *L, int event, int line) {

Callers 3

recoverFunction · 0.70
luaD_pcallFunction · 0.70
sweepthreadFunction · 0.70

Calls 2

stackinuseFunction · 0.70
luaD_reallocstackFunction · 0.70

Tested by

no test coverage detected