summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-25 14:45:36 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-25 14:45:36 -0200
commita53d9b66ca6247818acaf41e28cdf123082a272b (patch)
tree8e909200d4d925fc7394e6adf83cc5941456c588 /lgc.c
parentc8559e3c8d12e052783e2952db1372c68cc16059 (diff)
downloadlua-a53d9b66ca6247818acaf41e28cdf123082a272b.tar.gz
lua-a53d9b66ca6247818acaf41e28cdf123082a272b.tar.bz2
lua-a53d9b66ca6247818acaf41e28cdf123082a272b.zip
first implementation for type names
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;