lua-users home
lua-l archive

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


Hello,

On 2016-01-23 05:00, Wei John wrote:

Lua version is 5.2.4.

During GC sweep phase, when finish sweeping string,
GC switch to sweep userdata list:"g->finobj".
But all the white userdatas having "__gc" tag method are
separated to list "g->tobefnz" by function "separatetobefnz()"
during atomic phase, so there no white userdatas in "g->finobj"
after atomic.
What is the reason for GCSsweepudata、sweepfin ?

,,sweepfin'' is used as described: ,,current position of sweep in list 'finobj'''. For example, in the incremental mode, gc marks objects as white while in a sweep step -- quite well that there are no whites after atomic -- however, thanks to ,,sweepfin'', all udatas in ,,finobj'' are white after sweep:

1. Move all whites from ,,finobj'' to ,,tobefnz'' (now, there are no whites in ,,finobj'').
2. (Un)Mark remaining ,,finobj''s as whites (here ,,sweepfin'' is used).

Sweeping is for un-marking objects not only for releasing them (http://www.brpreiss.com/books/opus5/html/page424.html).

-- best regards

Cezary H. Noweta