mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 03:27:04 +09:00
Report collection counts non-inclusively (#51)
This commit is contained in:
parent
51785a4467
commit
50b175bcbb
1 changed files with 18 additions and 3 deletions
|
@ -197,13 +197,26 @@ unsigned SatoriGC::WhichGeneration(Object* obj)
|
||||||
|
|
||||||
int SatoriGC::CollectionCount(int generation, int get_bgc_fgc_coutn)
|
int SatoriGC::CollectionCount(int generation, int get_bgc_fgc_coutn)
|
||||||
{
|
{
|
||||||
//get_bgc_fgc_coutn N/A
|
// get_bgc_fgc_coutn - not sure what this is. thus N/A
|
||||||
|
|
||||||
if ((unsigned)generation > (unsigned)2)
|
if ((unsigned)generation > (unsigned)2)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)m_heap->Recycler()->GetCollectionCount(generation);
|
int64_t count = m_heap->Recycler()->GetCollectionCount(generation);
|
||||||
|
|
||||||
|
// in the public API GC counts are not inclusive
|
||||||
|
if (generation < 1)
|
||||||
|
{
|
||||||
|
count -= m_heap->Recycler()->GetCollectionCount(1);
|
||||||
|
}
|
||||||
|
else if (generation < 2)
|
||||||
|
{
|
||||||
|
count -= m_heap->Recycler()->GetCollectionCount(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int)count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SatoriGC::StartNoGCRegion(uint64_t totalSize, bool lohSizeKnown, uint64_t lohSize, bool disallowFullBlockingGC)
|
int SatoriGC::StartNoGCRegion(uint64_t totalSize, bool lohSizeKnown, uint64_t lohSize, bool disallowFullBlockingGC)
|
||||||
|
@ -360,6 +373,8 @@ bool SatoriGC::IsGCInProgressHelper(bool bConsiderGCStart)
|
||||||
return m_gcInProgress;
|
return m_gcInProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is basically a GC index
|
||||||
|
// it is used in suspend events, and in GC stress.
|
||||||
unsigned SatoriGC::GetGcCount()
|
unsigned SatoriGC::GetGcCount()
|
||||||
{
|
{
|
||||||
if (!m_heap)
|
if (!m_heap)
|
||||||
|
@ -367,7 +382,7 @@ unsigned SatoriGC::GetGcCount()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (unsigned)(int)m_heap->Recycler()->GetCollectionCount(/*gen*/ 1);
|
return (unsigned)(int)m_heap->Recycler()->GetCollectionCount(/*gen*/ 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SatoriGC::IsThreadUsingAllocationContextHeap(gc_alloc_context* acontext, int thread_number)
|
bool SatoriGC::IsThreadUsingAllocationContextHeap(gc_alloc_context* acontext, int thread_number)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue