From 746a1d612b975e1ec2b0ea906e6932f2497f5391 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 7 Jun 2005 15:53:45 -0300 Subject: [PATCH] small bug (type error) --- lcode.c | 4 ++-- lgc.c | 7 ++++--- lgc.h | 13 ++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lcode.c b/lcode.c index c835647f..d4239f02 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.12 2005/03/16 16:59:21 roberto Exp roberto $ +** $Id: lcode.c,v 2.13 2005/05/20 15:53:42 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -223,7 +223,7 @@ static int addk (FuncState *fs, TValue *k, TValue *v) { MAXARG_Bx, "constant table overflow"); while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); setobj(L, &f->k[fs->nk], v); - luaC_barriert(L, f, v); + luaC_barrier(L, f, v); return fs->nk++; } } diff --git a/lgc.c b/lgc.c index eee5555d..3d1af41f 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.32 2005/05/05 15:34:03 roberto Exp roberto $ +** $Id: lgc.c,v 2.33 2005/05/31 14:25:18 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -673,12 +673,13 @@ void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { } -void luaC_barrierback (lua_State *L, GCObject *o) { +void luaC_barrierback (lua_State *L, Table *t) { global_State *g = G(L); + GCObject *o = obj2gco(t); lua_assert(isblack(o) && !isdead(g, o)); lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); black2gray(o); /* make table gray (again) */ - gco2h(o)->gclist = g->grayagain; + t->gclist = g->grayagain; g->grayagain = o; } diff --git a/lgc.h b/lgc.h index 6c628a23..becc60fe 100644 --- a/lgc.h +++ b/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.12 2005/02/23 17:30:22 roberto Exp roberto $ +** $Id: lgc.h,v 2.13 2005/04/25 19:24:10 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -84,16 +84,15 @@ #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ luaC_barrierf(L,obj2gco(p),gcvalue(v)); } -#define luaC_barriert(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ - luaC_barrierback(L,obj2gco(p)); } +#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ + luaC_barrierback(L,t); } #define luaC_objbarrier(L,p,o) \ { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ luaC_barrierf(L,obj2gco(p),obj2gco(o)); } -#define luaC_objbarriert(L,p,o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ - luaC_barrierback(L,obj2gco(p)); } +#define luaC_objbarriert(L,t,o) \ + { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); LUAI_FUNC void luaC_callGCTM (lua_State *L); @@ -103,7 +102,7 @@ LUAI_FUNC void luaC_fullgc (lua_State *L); LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); -LUAI_FUNC void luaC_barrierback (lua_State *L, GCObject *o); +LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); #endif