MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / stack_init

Function stack_init

lib/lua/src/lstate.c:180–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178
179
180static void stack_init (lua_State *L1, lua_State *L) {
181 int i; CallInfo *ci;
182 /* initialize stack array */
183 L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
184 L1->tbclist.p = L1->stack.p;
185 for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
186 setnilvalue(s2v(L1->stack.p + i)); /* erase new stack */
187 L1->top.p = L1->stack.p;
188 L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE;
189 /* initialize first ci */
190 ci = &L1->base_ci;
191 ci->next = ci->previous = NULL;
192 ci->callstatus = CIST_C;
193 ci->func.p = L1->top.p;
194 ci->u.c.k = NULL;
195 ci->nresults = 0;
196 setnilvalue(s2v(L1->top.p)); /* 'function' entry for this 'ci' */
197 L1->top.p++;
198 ci->top.p = L1->top.p + LUA_MINSTACK;
199 L1->ci = ci;
200}
201
202
203static 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