@@ -1003,11 +1003,7 @@ LargeHeapBlock::VerifyMark()
1003
1003
1004
1004
unsigned char attributes = header->GetAttributes (this ->heapInfo ->recycler ->Cookie );
1005
1005
1006
- // In case of OOM we may not have completed processing of trackable objects and the NewFinalizeBit may not have been cleared.
1007
- if ((attributes & (TrackBit | NewTrackBit)) == (TrackBit | NewTrackBit))
1008
- {
1009
- Assert ((attributes & NewFinalizeBit) == 0 );
1010
- }
1006
+ Assert ((attributes & NewFinalizeBit) == 0 );
1011
1007
1012
1008
if ((attributes & LeafBit) != 0 )
1013
1009
{
@@ -1304,7 +1300,7 @@ LargeHeapBlock::RescanOnePage(Recycler * recycler)
1304
1300
// As such, our finalizeCount is not correct. Update it now.
1305
1301
1306
1302
RECYCLER_STATS_INC (recycler, finalizeCount);
1307
- header->SetAttributes (this -> heapInfo -> recycler ->Cookie , (attributes & ~NewFinalizeBit));
1303
+ header->SetAttributes (recycler->Cookie , (attributes & ~NewFinalizeBit));
1308
1304
}
1309
1305
#endif
1310
1306
@@ -1332,6 +1328,12 @@ LargeHeapBlock::RescanOnePage(Recycler * recycler)
1332
1328
if (attributes & TrackBit)
1333
1329
{
1334
1330
noOOMDuringMark = recycler->AddPreciselyTracedMark (reinterpret_cast <IRecyclerVisitedObject*>(objectAddress));
1331
+ if (noOOMDuringMark)
1332
+ {
1333
+ // Object has been successfully processed, so clear NewTrackBit
1334
+ header->SetAttributes (recycler->Cookie , (attributes & ~NewTrackBit));
1335
+ RECYCLER_STATS_INTERLOCKED_INC (recycler, trackCount);
1336
+ }
1335
1337
}
1336
1338
else
1337
1339
#endif
@@ -1418,7 +1420,7 @@ LargeHeapBlock::RescanMultiPage(Recycler * recycler)
1418
1420
continue ;
1419
1421
}
1420
1422
1421
- unsigned char attributes = header->GetAttributes (this -> heapInfo -> recycler ->Cookie );
1423
+ unsigned char attributes = header->GetAttributes (recycler->Cookie );
1422
1424
1423
1425
#ifdef RECYCLER_STATS
1424
1426
if (((attributes & FinalizeBit) != 0 ) && ((attributes & NewFinalizeBit) != 0 ))
@@ -1427,7 +1429,7 @@ LargeHeapBlock::RescanMultiPage(Recycler * recycler)
1427
1429
// As such, our finalizeCount is not correct. Update it now.
1428
1430
1429
1431
RECYCLER_STATS_INC (recycler, finalizeCount);
1430
- header->SetAttributes (this -> heapInfo -> recycler ->Cookie , (attributes & ~NewFinalizeBit));
1432
+ header->SetAttributes (recycler->Cookie , (attributes & ~NewFinalizeBit));
1431
1433
}
1432
1434
#endif
1433
1435
@@ -1460,6 +1462,12 @@ LargeHeapBlock::RescanMultiPage(Recycler * recycler)
1460
1462
if (attributes & TrackBit)
1461
1463
{
1462
1464
noOOMDuringMark = recycler->AddPreciselyTracedMark (reinterpret_cast <IRecyclerVisitedObject*>(objectAddress));
1465
+ if (noOOMDuringMark)
1466
+ {
1467
+ // Object has been successfully processed, so clear NewTrackBit
1468
+ header->SetAttributes (recycler->Cookie , (attributes & ~NewTrackBit));
1469
+ RECYCLER_STATS_INTERLOCKED_INC (recycler, trackCount);
1470
+ }
1463
1471
}
1464
1472
else
1465
1473
#endif
@@ -1570,6 +1578,12 @@ LargeHeapBlock::RescanMultiPage(Recycler * recycler)
1570
1578
header->markOnOOMRescan = true ;
1571
1579
}
1572
1580
}
1581
+ else
1582
+ {
1583
+ // Object has been successfully processed, so clear NewTrackBit
1584
+ header->SetAttributes (recycler->Cookie , (attributes & ~NewTrackBit));
1585
+ RECYCLER_STATS_INTERLOCKED_INC (recycler, trackCount);
1586
+ }
1573
1587
1574
1588
rescanCount = objectSize / AutoSystemInfo::PageSize +
1575
1589
(objectSize % AutoSystemInfo::PageSize != 0 ? 1 : 0 );
@@ -1989,11 +2003,7 @@ LargeHeapBlock::SweepObjects(Recycler * recycler)
1989
2003
{
1990
2004
#if DBG
1991
2005
unsigned char attributes = header->GetAttributes (recycler->Cookie );
1992
- // In case of OOM we may not have completed processing of trackable objects and the NewFinalizeBit may not have been cleared.
1993
- if ((attributes & (TrackBit | NewTrackBit)) == (TrackBit | NewTrackBit))
1994
- {
1995
- Assert ((attributes & NewFinalizeBit) == 0 );
1996
- }
2006
+ Assert ((attributes & NewFinalizeBit) == 0 );
1997
2007
#endif
1998
2008
1999
2009
RECYCLER_STATS_ADD (recycler, largeHeapBlockUsedByteCount, this ->GetHeaderByIndex (i)->objectSize );
0 commit comments