mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
remove l_G from Proto
This commit is contained in:
@@ -1018,13 +1018,8 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
|
||||
LUA_API void lua_clonefunction (lua_State *L, const void * fp) {
|
||||
LClosure *cl;
|
||||
LClosure *f = cast(LClosure *, fp);
|
||||
api_check(L, isshared(gcvalue(f->p)), "Not a shared proto");
|
||||
lua_lock(L);
|
||||
if (f->p->l_G == G(L)) {
|
||||
setclLvalue(L,L->top,f);
|
||||
api_incr_top(L);
|
||||
lua_unlock(L);
|
||||
return;
|
||||
}
|
||||
cl = luaF_newLclosure(L,f->nupvalues);
|
||||
setclLvalue(L,L->top,cl);
|
||||
api_incr_top(L);
|
||||
|
||||
@@ -117,7 +117,6 @@ Proto *luaF_newproto (lua_State *L) {
|
||||
f->linedefined = 0;
|
||||
f->lastlinedefined = 0;
|
||||
f->source = NULL;
|
||||
f->l_G = G(L);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,8 +496,6 @@ static lu_mem traversetable (global_State *g, Table *h) {
|
||||
*/
|
||||
static int traverseproto (global_State *g, Proto *f) {
|
||||
int i;
|
||||
if (g != f->l_G)
|
||||
return 0;
|
||||
markobjectN(g, f->source);
|
||||
for (i = 0; i < f->sizek; i++) /* mark literals */
|
||||
markvalue(g, &f->k[i]);
|
||||
|
||||
@@ -425,7 +425,6 @@ typedef struct Proto {
|
||||
Upvaldesc *upvalues; /* upvalue information */
|
||||
TString *source; /* used for debug information */
|
||||
GCObject *gclist;
|
||||
void *l_G; /* global state belongs to */
|
||||
} Proto;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user