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

Function luaD_growstack

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

Source from the content-addressed store, hash-verified

173
174
175void luaD_growstack (lua_State *L, int n) {
176 int size = L->stacksize;
177 if (size > LUAI_MAXSTACK) /* error after extra size? */
178 luaD_throw(L, LUA_ERRERR);
179 else {
180 int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK;
181 int newsize = 2 * size;
182 if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK;
183 if (newsize < needed) newsize = needed;
184 if (newsize > LUAI_MAXSTACK) { /* stack overflow? */
185 luaD_reallocstack(L, ERRORSTACKSIZE);
186 luaG_runerror(L, "stack overflow");
187 }
188 else
189 luaD_reallocstack(L, newsize);
190 }
191}
192
193
194static 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