MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaD_growstack

Function luaD_growstack

libraries/AP_Scripting/lua/src/ldo.c:200–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200void luaD_growstack (lua_State *L, int n) {
201 int size = L->stacksize;
202 if (size > LUAI_MAXSTACK) /* error after extra size? */
203 luaD_throw(L, LUA_ERRERR);
204 else {
205 int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK;
206 int newsize = 2 * size;
207 if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK;
208 if (newsize < needed) newsize = needed;
209 if (newsize > LUAI_MAXSTACK) { /* stack overflow? */
210 luaD_reallocstack(L, ERRORSTACKSIZE);
211 luaG_runerror(L, "stack overflow");
212 }
213 else
214 luaD_reallocstack(L, newsize);
215 }
216}
217
218
219static 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