| 117 | |
| 118 | |
| 119 | lua_State *luaE_newthread (lua_State *L) { |
| 120 | lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); |
| 121 | luaC_link(L, obj2gco(L1), LUA_TTHREAD); |
| 122 | preinit_state(L1, G(L)); |
| 123 | stack_init(L1, L); /* init stack */ |
| 124 | setobj2n(L, gt(L1), gt(L)); /* share table of globals */ |
| 125 | L1->hookmask = L->hookmask; |
| 126 | L1->basehookcount = L->basehookcount; |
| 127 | L1->hook = L->hook; |
| 128 | resethookcount(L1); |
| 129 | lua_assert(iswhite(obj2gco(L1))); |
| 130 | return L1; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | void luaE_freethread (lua_State *L, lua_State *L1) { |
no test coverage detected