From a3d36fe283c09d4e56474da98f22d13162cc9fec Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 11 Apr 2017 15:41:09 -0300 Subject: Upvalues collected like everything else (with mark-sweep) instead of reference count (simpler and better for generational mode) --- lvm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lvm.c') diff --git a/lvm.c b/lvm.c index 81b2a481..32958665 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.268 2016/02/05 19:59:14 roberto Exp roberto $ +** $Id: lvm.c,v 2.269 2017/04/06 13:08:56 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -642,7 +642,6 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); else /* get upvalue from enclosing function */ ncl->upvals[i] = encup[uv[i].idx]; - ncl->upvals[i]->refcount++; /* new closure is white, so we do not need a barrier here */ } if (!isblack(p)) /* cache will not break GC invariant? */ @@ -855,7 +854,7 @@ void luaV_execute (lua_State *L) { vmcase(OP_SETUPVAL) { UpVal *uv = cl->upvals[GETARG_B(i)]; setobj(L, uv->v, ra); - luaC_upvalbarrier(L, uv, ra); + luaC_barrier(L, uv, ra); vmbreak; } vmcase(OP_SETTABLE) { -- cgit v1.2.3-55-g6feb