remove l_G from Proto

This commit is contained in:
Cloud Wu
2019-06-17 11:21:01 +08:00
committed by 云风
parent 744fbea7ee
commit c80b462412
4 changed files with 1 additions and 10 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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]);

View File

@@ -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;