[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: two questions about gc
- From: roberto@... (Roberto Ierusalimschy)
- Date: Wed, 18 Jul 2007 02:10:35 -0300
> 1.what's the difference between luaC_barrierf and luaC_barrierback? i
> know both of them are used to keep the invariant, but why are there 2
> functions?
If you are assigning a white object to a black one, there are two ways
to restore the invariant: turn the white object into a gray one (so
move "forward" the gray line), or turn the black object into a gray one
(moving the gray line "back"). Based on some performance considerations,
we think that for some kinds of assignment it is better to mover forward
the barrier, while for others it is better to move it back.
> 2.in both of them, there is an assert "lua_assert(g->gcstate !=
> GCSfinalize && g->gcstate != GCSpause);", i know the GCPause statu is
> unbreakable, but it's not true for GCSfinalize, so why we can assert it
> here?
During the GCSfinalize phase, we have already sweeped all objects, so
no object should be black (and therefore these functions should not
be trigered).
-- Roberto