MCPcopy Create free account
hub / github.com/DFHack/dfhack / stack_init

Function stack_init

depends/lua/src/lstate.c:151–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150
151static void stack_init (lua_State *L1, lua_State *L) {
152 int i; CallInfo *ci;
153 /* initialize stack array */
154 L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue);
155 L1->stacksize = BASIC_STACK_SIZE;
156 for (i = 0; i < BASIC_STACK_SIZE; i++)
157 setnilvalue(L1->stack + i); /* erase new stack */
158 L1->top = L1->stack;
159 L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
160 /* initialize first ci */
161 ci = &L1->base_ci;
162 ci->next = ci->previous = NULL;
163 ci->callstatus = 0;
164 ci->func = L1->top;
165 setnilvalue(L1->top++); /* 'function' entry for this 'ci' */
166 ci->top = L1->top + LUA_MINSTACK;
167 L1->ci = ci;
168}
169
170
171static 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