MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaE_newthread

Function luaE_newthread

other_src/lua/src/lstate.cpp:122–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121
122lua_State *luaE_newthread (lua_State *L) {
123 lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
124 memcpy(fromstate(L1), fromstate(L), LUAI_EXTRASPACE);
125 luaC_link(L, obj2gco(L1), LUA_TTHREAD);
126 preinit_state(L1, G(L));
127 stack_init(L1, L); /* init stack */
128 setobj2n(L, gt(L1), gt(L)); /* share table of globals */
129 L1->hookmask = L->hookmask;
130 L1->basehookcount = L->basehookcount;
131 L1->hook = L->hook;
132 resethookcount(L1);
133 lua_assert(iswhite(obj2gco(L1)));
134 return L1;
135}
136
137
138void luaE_freethread (lua_State *L, lua_State *L1) {

Callers 1

lua_newthreadFunction · 0.70

Calls 3

luaC_linkFunction · 0.70
preinit_stateFunction · 0.70
stack_initFunction · 0.70

Tested by

no test coverage detected