diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-27 15:00:25 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-27 15:00:25 -0300 |
| commit | d53e2d23861814c2361e75d4622b3784a993823f (patch) | |
| tree | 5f596e15df6c10061985177cd6303848f438b629 | |
| parent | cf9a22396c1050f22176fc1367a4e7e2e4e3abc8 (diff) | |
| download | lua-d53e2d23861814c2361e75d4622b3784a993823f.tar.gz lua-d53e2d23861814c2361e75d4622b3784a993823f.tar.bz2 lua-d53e2d23861814c2361e75d4622b3784a993823f.zip | |
details
| -rw-r--r-- | lgc.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 1.24 1999/08/11 17:00:59 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.25 1999/08/16 20:52:00 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 | */ |
| @@ -143,10 +143,10 @@ static GCnode *listcollect (GCnode *l) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | 145 | ||
| 146 | static void strmark (TaggedString *s) { | 146 | /* |
| 147 | if (!s->head.marked) | 147 | ** mark a string; marks bigger than 1 cannot be changed. |
| 148 | s->head.marked = 1; | 148 | */ |
| 149 | } | 149 | #define strmark(s) {if ((s)->head.marked == 0) (s)->head.marked = 1;} |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | static void protomark (TProtoFunc *f) { | 152 | static void protomark (TProtoFunc *f) { |
| @@ -154,7 +154,7 @@ static void protomark (TProtoFunc *f) { | |||
| 154 | int i; | 154 | int i; |
| 155 | f->head.marked = 1; | 155 | f->head.marked = 1; |
| 156 | strmark(f->source); | 156 | strmark(f->source); |
| 157 | for (i=0; i<f->nconsts; i++) | 157 | for (i=f->nconsts-1; i>=0; i--) |
| 158 | markobject(&f->consts[i]); | 158 | markobject(&f->consts[i]); |
| 159 | } | 159 | } |
| 160 | } | 160 | } |
| @@ -174,7 +174,7 @@ static void hashmark (Hash *h) { | |||
| 174 | if (!h->head.marked) { | 174 | if (!h->head.marked) { |
| 175 | int i; | 175 | int i; |
| 176 | h->head.marked = 1; | 176 | h->head.marked = 1; |
| 177 | for (i=0; i<nhash(h); i++) { | 177 | for (i=nhash(h)-1; i>=0; i--) { |
| 178 | Node *n = node(h,i); | 178 | Node *n = node(h,i); |
| 179 | if (ttype(ref(n)) != LUA_T_NIL) { | 179 | if (ttype(ref(n)) != LUA_T_NIL) { |
| 180 | markobject(&n->ref); | 180 | markobject(&n->ref); |
