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

Function luaD_growstack

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

Source from the content-addressed store, hash-verified

218
219
220void luaD_growstack(lua_State *L, int n) {
221 int size = L->stacksize;
222 if (size > LUAI_MAXSTACK) /* error after extra size? */
223 luaD_throw(L, LUA_ERRERR);
224 else {
225 int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK;
226 int newsize = 2 * size;
227 if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK;
228 if (newsize < needed) newsize = needed;
229 if (newsize > LUAI_MAXSTACK) { /* stack overflow? */
230 luaD_reallocstack(L, ERRORSTACKSIZE);
231 luaG_runerror(L, "stack overflow");
232 }
233 else
234 luaD_reallocstack(L, newsize);
235 }
236}
237
238
239static int stackinuse(lua_State *L) {

Callers 1

growstackFunction · 0.85

Calls 3

luaD_throwFunction · 0.85
luaD_reallocstackFunction · 0.85
luaG_runerrorFunction · 0.85

Tested by

no test coverage detected