@@ -465,6 +465,8 @@ static void restartcollection (global_State *g) {
465
465
** TOUCHED1 objects need to be in the list. TOUCHED2 doesn't need to go
466
466
** back to a gray list, but then it must become OLD. (That is what
467
467
** 'correctgraylist' does when it finds a TOUCHED2 object.)
468
+ ** This function is a no-op in incremental mode, as objects cannot be
469
+ ** marked as touched in that mode.
468
470
*/
469
471
static void genlink (global_State * g , GCObject * o ) {
470
472
lua_assert (isblack (o ));
@@ -480,7 +482,8 @@ static void genlink (global_State *g, GCObject *o) {
480
482
** Traverse a table with weak values and link it to proper list. During
481
483
** propagate phase, keep it in 'grayagain' list, to be revisited in the
482
484
** atomic phase. In the atomic phase, if table has any white value,
483
- ** put it in 'weak' list, to be cleared.
485
+ ** put it in 'weak' list, to be cleared; otherwise, call 'genlink'
486
+ ** to check table age in generational mode.
484
487
*/
485
488
static void traverseweakvalue (global_State * g , Table * h ) {
486
489
Node * n , * limit = gnodelast (h );
@@ -501,6 +504,8 @@ static void traverseweakvalue (global_State *g, Table *h) {
501
504
linkgclist (h , g -> grayagain ); /* must retraverse it in atomic phase */
502
505
else if (hasclears )
503
506
linkgclist (h , g -> weak ); /* has to be cleared later */
507
+ else
508
+ genlink (g , obj2gco (h ));
504
509
}
505
510
506
511
0 commit comments