From a53d9b66ca6247818acaf41e28cdf123082a272b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Jan 2001 14:45:36 -0200 Subject: first implementation for type names --- lgc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index db713767..0c84da8f 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 1.77 2001/01/19 13:20:30 roberto Exp roberto $ +** $Id: lgc.c,v 1.78 2001/01/22 18:01:38 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -108,11 +108,13 @@ static void marklock (global_State *G, GCState *st) { static void marktagmethods (global_State *G, GCState *st) { - int e; - for (e=0; entag; t++) { - Closure *cl = luaT_gettm(G, t, e); + int t; + for (t=0; tntag; t++) { + struct TM *tm = &G->TMtable[t]; + int e; + if (tm->name) strmark(tm->name); + for (e=0; emethod[e]; if (cl) markclosure(st, cl); } } @@ -126,6 +128,7 @@ static void markall (lua_State *L) { marktagmethods(G(L), &st); /* mark tag methods */ markstacks(L, &st); /* mark all stacks */ marklock(G(L), &st); /* mark locked objects */ + marktable(&st, G(L)->type2tag); for (;;) { /* mark tables and closures */ if (st.cmark) { int i; -- cgit v1.2.3-55-g6feb