MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaD_shrinkstack

Function luaD_shrinkstack

src/Chain/libraries/glua/ldo.cpp:250–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250void 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
266void luaD_inctop(lua_State *L) {

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