lua-users home
lua-l archive

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


Roberto Ierusalimschy <roberto@inf.puc-rio.br> 于2020年5月7日周四 上午3:30写道:
>
> > For the function `youngcollection` :
> >
> >   /* sweep nursery and get a pointer to its last live element */
> >   psurvival = sweepgen(L, g, &g->allgc, g->survival);
> >   /* sweep 'survival' and 'old' */
> >   sweepgen(L, g, psurvival, g->reallyold);
> >
> > I think the second `sweepgen` is not about sweeping , it's about
> > advancing ages of objects. No sweeping happens here.
>
> Why not? White objects in the survival list are collected in this call.

Yes. It sweeps survival list but not for old list, no white objects in old list.

I'm just a little confused with the following code `g->reallyold =
g->old;` at the first time,
because it seems that `g->old` is in the list `psurvival` and it could
be free in this call.

So two things happens here, sweep 'survival` list and advance ages for
'old' list, no `freeobj` happens in 'old' list.

-- 
http://blog.codingnow.com
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org