Skip to content

Commit

Permalink
enable DATAS config via runtimeconfig.json (#87034)
Browse files Browse the repository at this point in the history
* enable DTAS config via runtimeconfig.json

* updating config name and switching it to INT_CONFIG
  • Loading branch information
mangod9 committed Jun 3, 2023
1 parent 0071d92 commit 93d8194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/coreclr/gc/gc.cpp
Expand Up @@ -14170,7 +14170,7 @@ gc_heap::init_semi_shared()
#ifdef MULTIPLE_HEAPS
mark_list_size = min (100*1024, max (8192, soh_segment_size/(2*10*32)));
#ifdef DYNAMIC_HEAP_COUNT
if (GCConfig::GetGCDynamicAdaptation() && GCConfig::GetHeapCount() == 0)
if (GCConfig::GetGCDynamicAdaptationMode() == 1 && GCConfig::GetHeapCount() == 0)
{
// we'll actually start with one heap in this case
g_mark_list_total_size = mark_list_size;
Expand Down Expand Up @@ -14380,7 +14380,7 @@ gc_heap::init_semi_shared()
#endif //FEATURE_EVENT_TRACE

conserve_mem_setting = (int)GCConfig::GetGCConserveMem();
if (conserve_mem_setting == 0 && GCConfig::GetGCDynamicAdaptation())
if (conserve_mem_setting == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1)
conserve_mem_setting = 5;
if (conserve_mem_setting < 0)
conserve_mem_setting = 0;
Expand Down Expand Up @@ -24882,7 +24882,7 @@ void gc_heap::check_heap_count ()
return;
}

if (!GCConfig::GetGCDynamicAdaptation())
if (GCConfig::GetGCDynamicAdaptationMode() == 0)
{
// don't change the heap count dynamically if the feature isn't explicitly enabled
return;
Expand Down Expand Up @@ -48067,7 +48067,7 @@ HRESULT GCHeap::Initialize()
{
#ifdef DYNAMIC_HEAP_COUNT
// if no heap count was specified, and we are told to adjust heap count dynamically ...
if (GCConfig::GetHeapCount() == 0 && GCConfig::GetGCDynamicAdaptation())
if (GCConfig::GetHeapCount() == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1)
{
// ... start with only 1 heap
gc_heap::g_heaps[0]->change_heap_count (1);
Expand Down Expand Up @@ -50509,7 +50509,7 @@ size_t gc_heap::get_gen0_min_size()
int n_heaps = 1;
#endif //SERVER_GC

if (GCConfig::GetGCConserveMem() != 0 || GCConfig::GetGCDynamicAdaptation())
if (GCConfig::GetGCConserveMem() != 0 || GCConfig::GetGCDynamicAdaptationMode() == 1)
{
// if we are asked to be stingy with memory, limit gen 0 size
gen0size = min (gen0size, (4*1024*1024));
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/gc/gcconfig.h
Expand Up @@ -138,7 +138,7 @@ class GCConfigStringHolder
INT_CONFIG (GCWriteBarrier, "GCWriteBarrier", NULL, 0, "Specifies whether GC should use more precise but slower write barrier") \
STRING_CONFIG(GCName, "GCName", "System.GC.Name", "Specifies the path of the standalone GC implementation.") \
INT_CONFIG (GCSpinCountUnit, "GCSpinCountUnit", 0, 0, "Specifies the spin count unit used by the GC.") \
BOOL_CONFIG (GCDynamicAdaptation, "GCDynamicAdaptation", NULL, false, "Enables varying the heap count dynamically in Server GC.")
INT_CONFIG (GCDynamicAdaptationMode, "GCDynamicAdaptationMode", "System.GC.DynamicAdaptationMode", 0, "Enable the GC to dynamically adapt to application sizes.")
// This class is responsible for retreiving configuration information
// for how the GC should operate.
class GCConfig
Expand Down

0 comments on commit 93d8194

Please sign in to comment.