MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaE_newthread

Function luaE_newthread

app/redis-6.2.6/deps/lua/src/lstate.c:119–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119lua_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
134void luaE_freethread (lua_State *L, lua_State *L1) {

Callers 1

lua_newthreadFunction · 0.85

Calls 3

luaC_linkFunction · 0.85
preinit_stateFunction · 0.70
stack_initFunction · 0.70

Tested by

no test coverage detected