From af35c7f398e8149b5f2481b63b399674e4ecdf7e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Aug 2013 15:53:35 -0300 Subject: upvalues collected by reference count --- lvm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index d29c0118..5ebeb30d 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.177 2013/08/16 18:55:49 roberto Exp roberto $ +** $Id: lvm.c,v 2.178 2013/08/19 14:18:43 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -416,7 +416,8 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, ncl->l.upvals[i] = luaF_findupval(L, base + uv[i].idx); else /* get upvalue from enclosing function */ ncl->l.upvals[i] = encup[uv[i].idx]; - /* new closure is white and local, so we do not need a barrier here */ + ncl->l.upvals[i]->refcount++; + /* new closure is white, so we do not need a barrier here */ } if (!isblack(obj2gco(p))) /* cache will not break GC invariant? */ p->cache = ncl; /* save it on cache for reuse */ @@ -591,7 +592,7 @@ void luaV_execute (lua_State *L) { vmcase(OP_SETUPVAL, UpVal *uv = cl->upvals[GETARG_B(i)]; setobj(L, uv->v, ra); - luaC_barrier(L, uv, ra); + luaC_upvalbarrier(L, uv); ) vmcase(OP_SETTABLE, Protect(luaV_settable(L, ra, RKB(i), RKC(i))); -- cgit v1.2.3-55-g6feb