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

Function preinit_thread

depends/lua/src/lstate.c:221–239  ·  view source on GitHub ↗

** preinitialize a thread with consistent values without allocating ** any memory (to avoid errors) */

Source from the content-addressed store, hash-verified

219** any memory (to avoid errors)
220*/
221static void preinit_thread (lua_State *L, global_State *g) {
222 G(L) = g;
223 L->stack = NULL;
224 L->ci = NULL;
225 L->nci = 0;
226 L->stacksize = 0;
227 L->twups = L; /* thread has no upvalues */
228 L->errorJmp = NULL;
229 L->nCcalls = 0;
230 L->hook = NULL;
231 L->hookmask = 0;
232 L->basehookcount = 0;
233 L->allowhook = 1;
234 resethookcount(L);
235 L->openupval = NULL;
236 L->nny = 1;
237 L->status = LUA_OK;
238 L->errfunc = 0;
239}
240
241
242static void close_state (lua_State *L) {

Callers 2

lua_newthreadFunction · 0.85
lua_newstateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected