static uint32_t GetIndexOfAppDomainBeingUnloaded();
static uint32_t GetTotalNumSizedRefHandles();
static bool AppDomainIsRudeUnload(void *appDomain);
+
+ static bool AnalyzeSurvivorsRequested(int condemnedGeneration);
+ static void AnalyzeSurvivorsFinished(int condemnedGeneration);
};
#endif // __GCENV_EE_H__
}
}
-#ifdef HEAP_ANALYZE
-inline
-BOOL AnalyzeSurvivorsRequested(int condemnedGeneration)
-{
-#ifndef BUILD_AS_STANDALONE
- // Is the list active?
- GcNotifications gn(g_pGcNotificationTable);
- if (gn.IsActive())
- {
- GcEvtArgs gea = { GC_MARK_END, { (1<<condemnedGeneration) } };
- if (gn.GetNotification(gea) != 0)
- {
- return TRUE;
- }
- }
-#endif // BUILD_AS_STANDALONE
- return FALSE;
-}
-
-void DACNotifyGcMarkEnd(int condemnedGeneration)
-{
-#ifndef BUILD_AS_STANDALONE
- // Is the list active?
- GcNotifications gn(g_pGcNotificationTable);
- if (gn.IsActive())
- {
- GcEvtArgs gea = { GC_MARK_END, { (1<<condemnedGeneration) } };
- if (gn.GetNotification(gea) != 0)
- {
- DACNotify::DoGCNotification(gea);
- }
- }
-#endif // BUILD_AS_STANDALONE
-}
-#endif // HEAP_ANALYZE
-
BOOL gc_heap::expand_soh_with_minimal_gc()
{
if ((size_t)(heap_segment_reserved (ephemeral_heap_segment) - heap_segment_allocated (ephemeral_heap_segment)) >= soh_allocation_no_gc)
#ifdef HEAP_ANALYZE
// At this point we've decided what generation is condemned
// See if we've been requested to analyze survivors after the mark phase
- if (AnalyzeSurvivorsRequested(settings.condemned_generation))
+ if (GCToEEInterface::AnalyzeSurvivorsRequested(settings.condemned_generation))
{
heap_analyze_enabled = TRUE;
}
{
#ifdef HEAP_ANALYZE
heap_analyze_enabled = FALSE;
- DACNotifyGcMarkEnd(condemned_gen_number);
+ GCToEEInterface::AnalyzeSurvivorsFinished(condemned_gen_number);
#endif // HEAP_ANALYZE
GCToEEInterface::AfterGcScanRoots (condemned_gen_number, max_generation, &sc);
return g_theGCToCLR->AppDomainIsRudeUnload(appDomain);
}
+inline bool GCToEEInterface::AnalyzeSurvivorsRequested(int condemnedGeneration)
+{
+ assert(g_theGCToCLR != nullptr);
+ return g_theGCToCLR->AnalyzeSurvivorsRequested(condemnedGeneration);
+}
+
+inline void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration)
+{
+ assert(g_theGCToCLR != nullptr);
+ g_theGCToCLR->AnalyzeSurvivorsFinished(condemnedGeneration);
+}
+
#endif // __GCTOENV_EE_STANDALONE_INL__
virtual
bool AppDomainIsRudeUnload(void *appDomain) = 0;
+
+ virtual
+ bool AnalyzeSurvivorsRequested(int condemnedGeneration) = 0;
+
+ virtual
+ void AnalyzeSurvivorsFinished(int condemnedGeneration) = 0;
};
#endif // _GCINTERFACE_EE_H_
{
return false;
}
+
+inline bool GCToEEInterface::AnalyzeSurvivorsRequested(int condemnedGeneration)
+{
+ return false;
+}
+
+inline void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration)
+{
+
+}
AppDomain *realPtr = static_cast<AppDomain *>(appDomain);
return realPtr->IsRudeUnload() != FALSE;
}
+
+bool GCToEEInterface::AnalyzeSurvivorsRequested(int condemnedGeneration)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ // Is the list active?
+ GcNotifications gn(g_pGcNotificationTable);
+ if (gn.IsActive())
+ {
+ GcEvtArgs gea = { GC_MARK_END, { (1<<condemnedGeneration) } };
+ if (gn.GetNotification(gea) != 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration)
+{
+ LIMITED_METHOD_CONTRACT;
+
+ // Is the list active?
+ GcNotifications gn(g_pGcNotificationTable);
+ if (gn.IsActive())
+ {
+ GcEvtArgs gea = { GC_MARK_END, { (1<<condemnedGeneration) } };
+ if (gn.GetNotification(gea) != 0)
+ {
+ DACNotify::DoGCNotification(gea);
+ }
+ }
+}
uint32_t GetIndexOfAppDomainBeingUnloaded();
uint32_t GetTotalNumSizedRefHandles();
bool AppDomainIsRudeUnload(void *appDomain);
+
+ bool AnalyzeSurvivorsRequested(int condemnedGeneration);
+ void AnalyzeSurvivorsFinished(int condemnedGeneration);
};
} // namespace standalone
NOTHROW;
GC_NOTRIGGER;
SO_INTOLERANT;
- MODE_PREEMPTIVE;
+ MODE_COOPERATIVE;
}
CONTRACTL_END;