lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Aug 30, 2002 at 10:57 -0700, Steve Dekorte wrote:
> 
> On Tuesday, August 27, 2002, at 10:37  AM, Thatcher Ulrich wrote:
> >On Aug 27, 2002 at 09:53 -0300, Roberto Ierusalimschy wrote:
> >>>The idea is to keep separate lists for each type of object (thus
> >>>eliminating the vtype variable) and not storing an explicit "marked"
> >>>value -- instead, the marked status is determined by which list the
> >>>object is linked into (white, gray, or black).
> >>
> >>Are you sure you can do that? You need a fast way to check the color
> >>of an object while running the mutator.
> >
> >Actually, I don't think you do -- IIRC with this algorithm, whenever
> >you need to mark an object and you don't know its color, it's always
> >correct to put it on the gray list.
> 
> I think you should mark it white in that case - gray means it's 
> referenced, but may or may not itself reference a white.

Hm -- marking things white is dangerous though!  White things won't
necessarily get scanned later by the collector.  Well, actually this
all depends on which consistency rules you're using to enforce the
invariant; there are a few different versions.

I think my original statement was wrong though -- it is necessary to
distinguish black from gray in the collector.  At the minimum, one
color bit is necessary.

-- 
Thatcher Ulrich
http://tulrich.com