diff options
Diffstat (limited to 'lgc.c')
| -rw-r--r-- | lgc.c | 15 |
1 files changed, 11 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 1.56 2000/06/08 17:48:31 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.57 2000/06/12 13:52:05 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 | */ |
| @@ -41,7 +41,7 @@ static void protomark (lua_State *L, Proto *f) { | |||
| 41 | protomark(L, f->kproto[i]); | 41 | protomark(L, f->kproto[i]); |
| 42 | if (f->locvars) { /* is there debug information? */ | 42 | if (f->locvars) { /* is there debug information? */ |
| 43 | LocVar *lv; | 43 | LocVar *lv; |
| 44 | for (lv=f->locvars; lv->line != -1; lv++) /* mark local-variable names */ | 44 | for (lv=f->locvars; lv->pc != -1; lv++) /* mark local-variable names */ |
| 45 | if (lv->varname) strmark(L, lv->varname); | 45 | if (lv->varname) strmark(L, lv->varname); |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| @@ -99,9 +99,16 @@ static int markobject (lua_State *L, TObject *o) { | |||
| 99 | case TAG_TABLE: | 99 | case TAG_TABLE: |
| 100 | tablemark(L, hvalue(o)); | 100 | tablemark(L, hvalue(o)); |
| 101 | break; | 101 | break; |
| 102 | case TAG_LCLOSURE: case TAG_LMARK: | 102 | case TAG_LCLOSURE: |
| 103 | protomark(L, clvalue(o)->f.l); | 103 | protomark(L, clvalue(o)->f.l); |
| 104 | /* go trhough */ | 104 | closuremark(L, clvalue(o)); |
| 105 | break; | ||
| 106 | case TAG_LMARK: { | ||
| 107 | Closure *cl = infovalue(o)->func; | ||
| 108 | protomark(L, cl->f.l); | ||
| 109 | closuremark(L, cl); | ||
| 110 | break; | ||
| 111 | } | ||
| 105 | case TAG_CCLOSURE: case TAG_CMARK: | 112 | case TAG_CCLOSURE: case TAG_CMARK: |
| 106 | closuremark(L, clvalue(o)); | 113 | closuremark(L, clvalue(o)); |
| 107 | break; | 114 | break; |
