MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaD_growstack

Function luaD_growstack

ThirdParty/lua/lua/ldo.c:186–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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