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

Function luaD_growstack

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

Source from the content-addressed store, hash-verified

243
244
245void luaD_growstack (lua_State *L, int n) {
246 int size = L->stacksize;
247 if (size > LUAI_MAXSTACK) /* error after extra size? */
248 luaD_throw(L, LUA_ERRERR);
249 else {
250 int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK;
251 int newsize = 2 * size;
252 if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK;
253 if (newsize < needed) newsize = needed;
254 if (newsize > LUAI_MAXSTACK) { /* stack overflow? */
255 luaD_reallocstack(L, ERRORSTACKSIZE);
256 luaG_runerror(L, "stack overflow");
257 }
258 else
259 luaD_reallocstack(L, newsize);
260 }
261}
262
263
264static int stackinuse (lua_State *L) {

Callers 1

growstackFunction · 0.70

Calls 3

luaD_throwFunction · 0.70
luaD_reallocstackFunction · 0.70
luaG_runerrorFunction · 0.70

Tested by

no test coverage detected