diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-12-02 10:06:10 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-12-02 10:06:10 -0200 |
commit | c75c3cfd19e807ba00c353da47dc49139e873b18 (patch) | |
tree | 29af20e57c36082037675b49f2ce50b721e9811e | |
parent | 24471525d7eccd14af19a54e84a3cf7a504a90de (diff) | |
download | lua-c75c3cfd19e807ba00c353da47dc49139e873b18.tar.gz lua-c75c3cfd19e807ba00c353da47dc49139e873b18.tar.bz2 lua-c75c3cfd19e807ba00c353da47dc49139e873b18.zip |
avoid names `str...' (may conflict with string.h)
-rw-r--r-- | lgc.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 1.163 2002/11/22 18:01:46 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.164 2002/11/25 12:38:47 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 | */ |
@@ -39,8 +39,7 @@ typedef struct GCState { | |||
39 | #define unmark(x) resetbit((x)->gch.marked, 0) | 39 | #define unmark(x) resetbit((x)->gch.marked, 0) |
40 | #define ismarked(x) ((x)->gch.marked & ((1<<4)|1)) | 40 | #define ismarked(x) ((x)->gch.marked & ((1<<4)|1)) |
41 | 41 | ||
42 | #define strmark(s) setbit((s)->tsv.marked, 0) | 42 | #define stringmark(s) setbit((s)->tsv.marked, 0) |
43 | #define strunmark(s) resetbit((s)->tsv.marked, 0) | ||
44 | 43 | ||
45 | 44 | ||
46 | #define isfinalized(u) (!testbit((u)->uv.marked, 1)) | 45 | #define isfinalized(u) (!testbit((u)->uv.marked, 1)) |
@@ -184,15 +183,15 @@ static void traversetable (GCState *st, Table *h) { | |||
184 | 183 | ||
185 | static void traverseproto (GCState *st, Proto *f) { | 184 | static void traverseproto (GCState *st, Proto *f) { |
186 | int i; | 185 | int i; |
187 | strmark(f->source); | 186 | stringmark(f->source); |
188 | for (i=0; i<f->sizek; i++) { | 187 | for (i=0; i<f->sizek; i++) { |
189 | if (ttisstring(f->k+i)) | 188 | if (ttisstring(f->k+i)) |
190 | strmark(tsvalue(f->k+i)); | 189 | stringmark(tsvalue(f->k+i)); |
191 | } | 190 | } |
192 | for (i=0; i<f->sizep; i++) | 191 | for (i=0; i<f->sizep; i++) |
193 | markvalue(st, f->p[i]); | 192 | markvalue(st, f->p[i]); |
194 | for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */ | 193 | for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */ |
195 | strmark(f->locvars[i].varname); | 194 | stringmark(f->locvars[i].varname); |
196 | lua_assert(luaG_checkcode(f)); | 195 | lua_assert(luaG_checkcode(f)); |
197 | } | 196 | } |
198 | 197 | ||
@@ -286,7 +285,7 @@ static void propagatemarks (GCState *st) { | |||
286 | 285 | ||
287 | static int valismarked (const TObject *o) { | 286 | static int valismarked (const TObject *o) { |
288 | if (ttisstring(o)) | 287 | if (ttisstring(o)) |
289 | strmark(tsvalue(o)); /* strings are `values', so are never weak */ | 288 | stringmark(tsvalue(o)); /* strings are `values', so are never weak */ |
290 | return !iscollectable(o) || testbit(o->value.gc->gch.marked, 0); | 289 | return !iscollectable(o) || testbit(o->value.gc->gch.marked, 0); |
291 | } | 290 | } |
292 | 291 | ||