MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / stack_init

Function stack_init

3rd/lua-5.4.3/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 = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
184 L1->tbclist = L1->stack;
185 for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
186 setnilvalue(s2v(L1->stack + i)); /* erase new stack */
187 L1->top = L1->stack;
188 L1->stack_last = L1->stack + 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 = L1->top;
194 ci->u.c.k = NULL;
195 ci->nresults = 0;
196 setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
197 L1->top++;
198 ci->top = L1->top + 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