diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-16 15:55:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-16 15:55:49 -0300 |
commit | 439d74e29f3234a034777f88b260523afe8c0446 (patch) | |
tree | a3ee160dccfd3cf0f065edbba07290c4ba9af93d /lfunc.c | |
parent | 3679d33b02782ff7d7d0fa163b815902b189c89e (diff) | |
download | lua-439d74e29f3234a034777f88b260523afe8c0446.tar.gz lua-439d74e29f3234a034777f88b260523afe8c0446.tar.bz2 lua-439d74e29f3234a034777f88b260523afe8c0446.zip |
added 'local' bit (true => object is only refered by local variables)
Diffstat (limited to 'lfunc.c')
-rw-r--r-- | lfunc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 2.31 2013/08/05 16:58:28 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.32 2013/08/07 12:18:11 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -80,6 +80,7 @@ void luaF_close (lua_State *L, StkId level) { | |||
80 | uv->v = &uv->value; /* now current value lives here */ | 80 | uv->v = &uv->value; /* now current value lives here */ |
81 | gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ | 81 | gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ |
82 | g->allgc = o; | 82 | g->allgc = o; |
83 | valnolocal(uv->v); /* keep local invariant */ | ||
83 | luaC_checkupvalcolor(g, uv); | 84 | luaC_checkupvalcolor(g, uv); |
84 | } | 85 | } |
85 | } | 86 | } |
@@ -88,6 +89,7 @@ void luaF_close (lua_State *L, StkId level) { | |||
88 | 89 | ||
89 | Proto *luaF_newproto (lua_State *L) { | 90 | Proto *luaF_newproto (lua_State *L) { |
90 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; | 91 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; |
92 | nolocal(obj2gco(f)); /* prototypes are never local */ | ||
91 | f->k = NULL; | 93 | f->k = NULL; |
92 | f->sizek = 0; | 94 | f->sizek = 0; |
93 | f->p = NULL; | 95 | f->p = NULL; |