MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaE_newthread

Function luaE_newthread

Source/Misc/lua/src/lua.c:9034–9046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9032
9033
9034lua_State *luaE_newthread (lua_State *L) {
9035lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
9036luaC_link(L, obj2gco(L1), LUA_TTHREAD);
9037preinit_state(L1, G(L));
9038stack_init(L1, L); /* init stack */
9039setobj2n(L, gt(L1), gt(L)); /* share table of globals */
9040L1->hookmask = L->hookmask;
9041L1->basehookcount = L->basehookcount;
9042L1->hook = L->hook;
9043resethookcount(L1);
9044lua_assert(iswhite(obj2gco(L1)));
9045return L1;
9046}
9047
9048
9049void luaE_freethread (lua_State *L, lua_State *L1) {

Callers 1

lua_newthreadFunction · 0.85

Calls 3

luaC_linkFunction · 0.85
preinit_stateFunction · 0.85
stack_initFunction · 0.85

Tested by

no test coverage detected