From 9eff921f8fe689794308cdb3fa7bb214604f75d3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 19 Aug 2013 11:18:43 -0300 Subject: "barrier" for link prototype->cache changed to be consistent with GC behavior (link is cleared to preserve invariant) --- lgc.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index e4d6b6c1..b7d564c4 100644 --- a/lgc.c +++ b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.145 2013/08/13 17:36:44 roberto Exp roberto $ +** $Id: lgc.c,v 2.146 2013/08/16 18:55:49 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -171,28 +171,6 @@ void luaC_barrierback_ (lua_State *L, GCObject *o) { } -/* -** barrier for prototypes. When creating first closure (cache is -** NULL), use a forward barrier; this may be the only closure of the -** prototype (if it is a "regular" function, with a single instance) -** and the prototype may be big, so it is better to avoid traversing -** it again. Otherwise, use a backward barrier, to avoid marking all -** possible instances. -*/ -LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c) { - global_State *g = G(L); - lua_assert(isblack(obj2gco(p))); - if (p->cache == NULL) { /* first time? */ - luaC_objbarrier(L, p, c); - } - else { /* use a backward barrier */ - black2gray(obj2gco(p)); /* make prototype gray (again) */ - p->gclist = g->grayagain; - g->grayagain = obj2gco(p); - } -} - - /* ** check color (and invariants) for an upvalue that is being closed, ** i.e., moved into the 'allgc' list -- cgit v1.2.3-55-g6feb