lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> 于2020年5月1日周五 上午5:39写道:
>
> Lua 5.4.0 (rc2) is now available for testing at
>         http://www.lua.org/work/lua-5.4.0-rc2.tar.gz
>

I'm reading the source code today, and I found maybe adding some
comments in lgc.c would be better.

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.

So  /* sweep 'survival' and 'old' */  ->  /* advance ages 'survival'
and 'old' */ would be better ?

I prefer a better function name for `sweepgen`, something like
`sweepandadvanceages`, or split this function into two :
one is for sweeping and ages  another is only for advancing ages.

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