未验证 提交 d1111e56 编写于 作者: A Andrew Au 提交者: GitHub

Make some region parameters configurable (#50603)

上级 d927fcbb
......@@ -40344,7 +40344,12 @@ HRESULT GCHeap::Initialize()
#ifdef MULTIPLE_HEAPS
gc_heap::soh_segment_size /= 4;
#endif //MULTIPLE_HEAPS
gc_heap::min_segment_size_shr = index_of_highest_set_bit (REGION_SIZE);
size_t gc_region_size = (size_t)GCConfig::GetGCRegionsSize();
if (!power_of_two_p(gc_region_size) || ((gc_region_size * nhp * 19) > gc_heap::regions_range))
{
return E_INVALIDARG;
}
gc_heap::min_segment_size_shr = index_of_highest_set_bit (gc_region_size);
#else
gc_heap::min_segment_size_shr = index_of_highest_set_bit (gc_heap::min_segment_size);
#endif //USE_REGIONS
......@@ -102,7 +102,8 @@ public:
INT_CONFIG (GCHeapHardLimit, "GCHeapHardLimit", "System.GC.HeapHardLimit", 0, "Specifies a hard limit for the GC heap") \
INT_CONFIG (GCHeapHardLimitPercent, "GCHeapHardLimitPercent", "System.GC.HeapHardLimitPercent", 0, "Specifies the GC heap usage as a percentage of the total memory") \
INT_CONFIG (GCTotalPhysicalMemory, "GCTotalPhysicalMemory", NULL, 0, "Specifies what the GC should consider to be total physical memory") \
INT_CONFIG (GCRegionsRange, "GCRegionsRange", NULL, 0, "Specifies the range for the GC heap") \
INT_CONFIG (GCRegionsRange, "GCRegionsRange", NULL, 274877906944L, "Specifies the range for the GC heap") \
INT_CONFIG (GCRegionsSize, "GCRegionsSize", NULL, 4194304, "Specifies the size for a basic GC region") \
STRING_CONFIG(LogFile, "GCLogFile", NULL, "Specifies the name of the GC log file") \
STRING_CONFIG(ConfigLogFile, "GCConfigLogFile", NULL, "Specifies the name of the GC config log file") \
INT_CONFIG (BGCFLTuningEnabled, "BGCFLTuningEnabled", NULL, 0, "Enables FL tuning") \
......
......@@ -5278,8 +5278,6 @@ public:
// and free_large_regions. These decommitted regions will be returned to region_allocator which
// mark the space as free blocks.
//
// Make configs available to change these.
#define REGION_SIZE ((size_t)4 * 1024 * 1024)
#define LARGE_REGION_FACTOR (8)
#define region_alloc_free_bit (1 << (sizeof (uint32_t) * 8 - 1))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册