Skip to content

Commit 7233dff

Browse files
committed
Code Review Feedback
1 parent 376e34b commit 7233dff

7 files changed

Lines changed: 11 additions & 18 deletions

File tree

src/coreclr/gc/gc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46323,9 +46323,9 @@ void GCHeap::GetMemoryInfo(uint64_t* highMemLoadThresholdBytes,
4632346323
#endif //_DEBUG
4632446324
}
4632546325

46326-
uint64_t GCHeap::GetTotalPauseDuration()
46326+
int64_t GCHeap::GetTotalPauseDuration()
4632746327
{
46328-
return gc_heap::total_suspended_time;
46328+
return (int64_t)(gc_heap::total_suspended_time * 10);
4632946329
}
4633046330

4633146331
uint32_t GCHeap::GetMemoryLoad()

src/coreclr/gc/gcimpl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ class GCHeap : public IGCHeapInternal
182182
uint64_t* pauseInfoRaw,
183183
int kind);
184184

185-
// AndrewTodo: Does the order of methods in this interface matters?
186-
uint64_t GetTotalPauseDuration();
185+
int64_t GetTotalPauseDuration();
187186

188187
uint32_t GetMemoryLoad();
189188

src/coreclr/gc/gcinterface.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,6 @@ class IGCHeap {
652652
// Get the last memory load in percentage observed by the last GC.
653653
virtual uint32_t GetMemoryLoad() = 0;
654654

655-
// Get the total paused duration
656-
// AndrewTodo: Does the order of methods in this interface matters?
657-
virtual uint64_t GetTotalPauseDuration() = 0;
658-
659655
// Gets the current GC latency mode.
660656
virtual int GetGcLatencyMode() = 0;
661657

@@ -927,6 +923,9 @@ class IGCHeap {
927923

928924
virtual unsigned int GetGenerationWithRange(Object* object, uint8_t** ppStart, uint8_t** ppAllocated, uint8_t** ppReserved) = 0;
929925

926+
// Get the total paused duration
927+
virtual int64_t GetTotalPauseDuration() = 0;
928+
930929
IGCHeap() {}
931930
virtual ~IGCHeap() {}
932931
};

src/coreclr/nativeaot/Runtime/GCHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,5 +342,5 @@ EXTERN_C REDHAWK_API void RhAllocateNewObject(MethodTable* pEEType, uint32_t fla
342342

343343
COOP_PINVOKE_HELPER(int64_t, RhGetTotalPauseDuration, ())
344344
{
345-
return (int64_t)(GCHeapUtilities::GetGCHeap()->GetTotalPauseDuration() * 10);
345+
return GCHeapUtilities::GetGCHeap()->GetTotalPauseDuration();
346346
}

src/coreclr/vm/comutilnative.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,18 +674,13 @@ UINT64 GCInterface::m_remPressure[MEM_PRESSURE_COUNT] = {0, 0, 0, 0}; // his
674674
// (m_iteration % MEM_PRESSURE_COUNT) is used as an index into m_addPressure and m_remPressure
675675
UINT GCInterface::m_iteration = 0;
676676

677-
FCIMPL0(INT64, GCInterface::_GetTotalPauseDuration)
677+
FCIMPL0(INT64, GCInterface::GetTotalPauseDuration)
678678
{
679679
FCALL_CONTRACT;
680680

681681
FC_GC_POLL_NOT_NEEDED();
682682

683-
// Unsigned to signed conversion happened here
684-
685-
// GetTotalPauseDuration returned microseconds, but the TimeSpan constructor requires
686-
// 100 nanosecond unit.
687-
688-
return (int64_t)(GCHeapUtilities::GetGCHeap()->GetTotalPauseDuration() * 10);
683+
return GCHeapUtilities::GetGCHeap()->GetTotalPauseDuration();
689684
}
690685
FCIMPLEND
691686

src/coreclr/vm/comutilnative.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class GCInterface {
134134
static FORCEINLINE UINT64 InterlockedAdd(UINT64 *pAugend, UINT64 addend);
135135
static FORCEINLINE UINT64 InterlockedSub(UINT64 *pMinuend, UINT64 subtrahend);
136136

137-
static FCDECL0(INT64, _GetTotalPauseDuration);
137+
static FCDECL0(INT64, GetTotalPauseDuration);
138138
static FCDECL2(void, GetMemoryInfo, Object* objUNSAFE, int kind);
139139
static FCDECL0(UINT32, GetMemoryLoad);
140140
static FCDECL0(int, GetGcLatencyMode);

src/coreclr/vm/ecalllist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ FCFuncStart(gGCInterfaceFuncs)
475475
FCFuncElement("_WaitForFullGCComplete", GCInterface::WaitForFullGCComplete)
476476
FCFuncElement("_CollectionCount", GCInterface::CollectionCount)
477477
FCFuncElement("GetMemoryInfo", GCInterface::GetMemoryInfo)
478-
FCFuncElement("_GetTotalPauseDuration", GCInterface::_GetTotalPauseDuration)
478+
FCFuncElement("_GetTotalPauseDuration", GCInterface::GetTotalPauseDuration)
479479
FCFuncElement("GetMemoryLoad", GCInterface::GetMemoryLoad)
480480
FCFuncElement("GetSegmentSize", GCInterface::GetSegmentSize)
481481
FCFuncElement("GetLastGCPercentTimeInGC", GCInterface::GetLastGCPercentTimeInGC)

0 commit comments

Comments
 (0)