[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why sweep userdata list "g->finobj" during sweep phase?
- From: "Cezary H. Noweta" <chn@...>
- Date: Mon, 25 Jan 2016 13:05:50 +0100
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"
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
-- best regards
Cezary H. Noweta