MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / stack_init

Function stack_init

ThirdParty/lua/lua/lstate.c:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

f_luaopenFunction · 0.70
lua_newthreadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected