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

Function stack_init

libraries/AP_Scripting/lua/src/lstate.c:159–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157
158
159static void stack_init (lua_State *L1, lua_State *L) {
160 int i; CallInfo *ci;
161 /* initialize stack array */
162 L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue);
163 L1->stacksize = BASIC_STACK_SIZE;
164 for (i = 0; i < BASIC_STACK_SIZE; i++)
165 setnilvalue(L1->stack + i); /* erase new stack */
166 L1->top = L1->stack;
167 L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
168 /* initialize first ci */
169 ci = &L1->base_ci;
170 ci->next = ci->previous = NULL;
171 ci->callstatus = 0;
172 ci->func = L1->top;
173 setnilvalue(L1->top++); /* 'function' entry for this 'ci' */
174 ci->top = L1->top + LUA_MINSTACK;
175 L1->ci = ci;
176}
177
178
179static void freestack (lua_State *L) {

Callers 2

f_luaopenFunction · 0.85
lua_newthreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected