Skip to content

Commit 6b26689

Browse files
committed
Revert "Report collection counts non-inclusively (VSadov#51)" (VSadov#52)
This reverts commit 50b175b.
1 parent e75c4b7 commit 6b26689

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/coreclr/gc/satori/SatoriGC.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -197,26 +197,13 @@ unsigned SatoriGC::WhichGeneration(Object* obj)
197197

198198
int SatoriGC::CollectionCount(int generation, int get_bgc_fgc_coutn)
199199
{
200-
// get_bgc_fgc_coutn - not sure what this is. thus N/A
201-
200+
//get_bgc_fgc_coutn N/A
202201
if ((unsigned)generation > (unsigned)2)
203202
{
204203
return 0;
205204
}
206205

207-
int64_t count = m_heap->Recycler()->GetCollectionCount(generation);
208-
209-
// in the public API GC counts are not inclusive
210-
if (generation < 1)
211-
{
212-
count -= m_heap->Recycler()->GetCollectionCount(1);
213-
}
214-
else if (generation < 2)
215-
{
216-
count -= m_heap->Recycler()->GetCollectionCount(2);
217-
}
218-
219-
return (int)count;
206+
return (int)m_heap->Recycler()->GetCollectionCount(generation);
220207
}
221208

222209
int SatoriGC::StartNoGCRegion(uint64_t totalSize, bool lohSizeKnown, uint64_t lohSize, bool disallowFullBlockingGC)
@@ -373,16 +360,14 @@ bool SatoriGC::IsGCInProgressHelper(bool bConsiderGCStart)
373360
return m_gcInProgress;
374361
}
375362

376-
// this is basically a GC index
377-
// it is used in suspend events, and in GC stress.
378363
unsigned SatoriGC::GetGcCount()
379364
{
380365
if (!m_heap)
381366
{
382367
return 0;
383368
}
384369

385-
return (unsigned)(int)m_heap->Recycler()->GetCollectionCount(/*gen*/ 0);
370+
return (unsigned)(int)m_heap->Recycler()->GetCollectionCount(/*gen*/ 1);
386371
}
387372

388373
bool SatoriGC::IsThreadUsingAllocationContextHeap(gc_alloc_context* acontext, int thread_number)

0 commit comments

Comments
 (0)