MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / luaD_growstack

Function luaD_growstack

Plugins/slua_unreal/External/lua/ldo.cpp:185–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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