diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-12-19 09:11:55 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-12-19 09:11:55 -0200 |
commit | dd8edecae19251a3b89502416a2e7f8e75b2bd20 (patch) | |
tree | 10c94c2a2f89f534ca9a5b9b2591008bda8eae17 /lgc.c | |
parent | 28021c5c663702a1b1890f0e5d280c36be8a6c16 (diff) | |
download | lua-dd8edecae19251a3b89502416a2e7f8e75b2bd20.tar.gz lua-dd8edecae19251a3b89502416a2e7f8e75b2bd20.tar.bz2 lua-dd8edecae19251a3b89502416a2e7f8e75b2bd20.zip |
new functions to manipulate upvales (get/setupvalue)
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 1.165 2002/12/02 12:06:10 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.166 2002/12/04 17:38:31 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -186,11 +186,13 @@ static void traversetable (GCState *st, Table *h) { | |||
186 | static void traverseproto (GCState *st, Proto *f) { | 186 | static void traverseproto (GCState *st, Proto *f) { |
187 | int i; | 187 | int i; |
188 | stringmark(f->source); | 188 | stringmark(f->source); |
189 | for (i=0; i<f->sizek; i++) { | 189 | for (i=0; i<f->sizek; i++) { /* mark literal strings */ |
190 | if (ttisstring(f->k+i)) | 190 | if (ttisstring(f->k+i)) |
191 | stringmark(tsvalue(f->k+i)); | 191 | stringmark(tsvalue(f->k+i)); |
192 | } | 192 | } |
193 | for (i=0; i<f->sizep; i++) | 193 | for (i=0; i<f->nupvalues; i++) /* mark upvalue names */ |
194 | stringmark(f->upvalues[i]); | ||
195 | for (i=0; i<f->sizep; i++) /* mark nested protos */ | ||
194 | markvalue(st, f->p[i]); | 196 | markvalue(st, f->p[i]); |
195 | for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */ | 197 | for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */ |
196 | stringmark(f->locvars[i].varname); | 198 | stringmark(f->locvars[i].varname); |