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

Function luaD_growstack

third-party/lua-5.3.5/src/ldo.c:191–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191void luaD_growstack (lua_State *L, int n) {
192 int size = L->stacksize;
193 if (size > LUAI_MAXSTACK) /* error after extra size? */
194 luaD_throw(L, LUA_ERRERR);
195 else {
196 int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK;
197 int newsize = 2 * size;
198 if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK;
199 if (newsize < needed) newsize = needed;
200 if (newsize > LUAI_MAXSTACK) { /* stack overflow? */
201 luaD_reallocstack(L, ERRORSTACKSIZE);
202 luaG_runerror(L, "stack overflow");
203 }
204 else
205 luaD_reallocstack(L, newsize);
206 }
207}
208
209
210static 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