summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lgc.c b/lgc.c
index db713767..0c84da8f 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.77 2001/01/19 13:20:30 roberto Exp roberto $ 2** $Id: lgc.c,v 1.78 2001/01/22 18:01:38 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*/
@@ -108,11 +108,13 @@ static void marklock (global_State *G, GCState *st) {
108 108
109 109
110static void marktagmethods (global_State *G, GCState *st) { 110static void marktagmethods (global_State *G, GCState *st) {
111 int e; 111 int t;
112 for (e=0; e<TM_N; e++) { 112 for (t=0; t<G->ntag; t++) {
113 int t; 113 struct TM *tm = &G->TMtable[t];
114 for (t=0; t<G->ntag; t++) { 114 int e;
115 Closure *cl = luaT_gettm(G, t, e); 115 if (tm->name) strmark(tm->name);
116 for (e=0; e<TM_N; e++) {
117 Closure *cl = tm->method[e];
116 if (cl) markclosure(st, cl); 118 if (cl) markclosure(st, cl);
117 } 119 }
118 } 120 }
@@ -126,6 +128,7 @@ static void markall (lua_State *L) {
126 marktagmethods(G(L), &st); /* mark tag methods */ 128 marktagmethods(G(L), &st); /* mark tag methods */
127 markstacks(L, &st); /* mark all stacks */ 129 markstacks(L, &st); /* mark all stacks */
128 marklock(G(L), &st); /* mark locked objects */ 130 marklock(G(L), &st); /* mark locked objects */
131 marktable(&st, G(L)->type2tag);
129 for (;;) { /* mark tables and closures */ 132 for (;;) { /* mark tables and closures */
130 if (st.cmark) { 133 if (st.cmark) {
131 int i; 134 int i;