MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaD_shrinkstack

Function luaD_shrinkstack

ThirdParty/lua/lua/ldo.c:216–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215
216void luaD_shrinkstack (lua_State *L) {
217 int inuse = stackinuse(L);
218 int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK;
219 if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK;
220 if (L->stacksize > LUAI_MAXSTACK) /* was handling stack overflow? */
221 luaE_freeCI(L); /* free all CIs (list grew because of an error) */
222 else
223 luaE_shrinkCI(L); /* shrink list */
224 if (inuse > LUAI_MAXSTACK || /* still handling stack overflow? */
225 goodsize >= L->stacksize) /* would grow instead of shrink? */
226 condmovestack(L); /* don't change stack (change only for debugging) */
227 else
228 luaD_reallocstack(L, goodsize); /* shrink it */
229}
230
231
232void luaD_hook (lua_State *L, int event, int line) {

Callers 3

recoverFunction · 0.85
luaD_pcallFunction · 0.85
traversethreadFunction · 0.85

Calls 4

stackinuseFunction · 0.85
luaE_freeCIFunction · 0.85
luaE_shrinkCIFunction · 0.85
luaD_reallocstackFunction · 0.85

Tested by

no test coverage detected