MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / stack_init

Function stack_init

third-party/lua-5.2.4/src/lstate.c:133–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132
133static void stack_init (lua_State *L1, lua_State *L) {
134 int i; CallInfo *ci;
135 /* initialize stack array */
136 L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue);
137 L1->stacksize = BASIC_STACK_SIZE;
138 for (i = 0; i < BASIC_STACK_SIZE; i++)
139 setnilvalue(L1->stack + i); /* erase new stack */
140 L1->top = L1->stack;
141 L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
142 /* initialize first ci */
143 ci = &L1->base_ci;
144 ci->next = ci->previous = NULL;
145 ci->callstatus = 0;
146 ci->func = L1->top;
147 setnilvalue(L1->top++); /* 'function' entry for this 'ci' */
148 ci->top = L1->top + LUA_MINSTACK;
149 L1->ci = ci;
150}
151
152
153static 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