MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / stack_init

Function stack_init

extlibs/lua/src/lstate.c:207–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207static void stack_init (lua_State *L1, lua_State *L) {
208 int i; CallInfo *ci;
209 /* initialize stack array */
210 L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, StackValue);
211 L1->stacksize = BASIC_STACK_SIZE;
212 for (i = 0; i < BASIC_STACK_SIZE; i++)
213 setnilvalue(s2v(L1->stack + i)); /* erase new stack */
214 L1->top = L1->stack;
215 L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
216 /* initialize first ci */
217 ci = &L1->base_ci;
218 ci->next = ci->previous = NULL;
219 ci->callstatus = CIST_C;
220 ci->func = L1->top;
221 ci->u.c.k = NULL;
222 ci->nresults = 0;
223 setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */
224 L1->top++;
225 ci->top = L1->top + LUA_MINSTACK;
226 L1->ci = ci;
227}
228
229
230static 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