MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaD_shrinkstack

Function luaD_shrinkstack

freebsd/contrib/openzfs/module/lua/ldo.c:275–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273
274
275void 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
287void luaD_hook (lua_State *L, int event, int line) {

Callers 3

recoverFunction · 0.85
luaD_pcallFunction · 0.85
sweepthreadFunction · 0.85

Calls 2

stackinuseFunction · 0.85
luaD_reallocstackFunction · 0.70

Tested by

no test coverage detected