未验证 提交 0dc0bee0 编写于 作者: M Mukund Raghav Sharma 提交者: GitHub

Removed the hard heap limit heap balancing logic for regions + UOH and fixed...

Removed the hard heap limit heap balancing logic for regions + UOH and fixed infinite retries in case at the LOH boundary (#67406)

* Removed the hard heap limit heap balancing logic for uoh and fixed inifite retries

* Addressed feedback - refactored region checking directives

* Removed all instances of hard_limit_exceeded_p as it is no longer needed
上级 2eddb3dd
......@@ -6803,7 +6803,7 @@ bool gc_heap::virtual_alloc_commit_for_heap (void* addr, size_t size, int h_numb
return GCToOSInterface::VirtualCommit(addr, size);
}
bool gc_heap::virtual_commit (void* address, size_t size, gc_oh_num oh, int h_number, bool* hard_limit_exceeded_p)
bool gc_heap::virtual_commit (void* address, size_t size, gc_oh_num oh, int h_number)
{
#ifndef HOST_64BIT
assert (heap_hard_limit == 0);
......@@ -6841,9 +6841,6 @@ bool gc_heap::virtual_commit (void* address, size_t size, gc_oh_num oh, int h_nu
check_commit_cs.Leave();
if (hard_limit_exceeded_p)
*hard_limit_exceeded_p = exceeded_p;
if (exceeded_p)
{
dprintf (1, ("can't commit %Ix for %Id bytes > HARD LIMIT %Id", (size_t)address, size, heap_hard_limit));
......@@ -14220,13 +14217,10 @@ BOOL gc_heap::a_size_fit_p (size_t size, uint8_t* alloc_pointer, uint8_t* alloc_
}
// Grow by committing more pages
BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool* hard_limit_exceeded_p)
BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address)
{
assert (high_address <= heap_segment_reserved (seg));
if (hard_limit_exceeded_p)
*hard_limit_exceeded_p = false;
//return 0 if we are at the end of the segment.
if (align_on_page (high_address) > heap_segment_reserved (seg))
return FALSE;
......@@ -14245,7 +14239,7 @@ BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool*
"Growing heap_segment: %Ix high address: %Ix\n",
(size_t)seg, (size_t)high_address);
bool ret = virtual_commit (heap_segment_committed (seg), c_size, heap_segment_oh (seg), heap_number, hard_limit_exceeded_p);
bool ret = virtual_commit (heap_segment_committed (seg), c_size, heap_segment_oh (seg), heap_number);
if (ret)
{
heap_segment_committed (seg) += c_size;
......@@ -16130,7 +16124,6 @@ BOOL gc_heap::a_fit_segment_end_p (int gen_number,
{
*commit_failed_p = FALSE;
size_t limit = 0;
bool hard_limit_short_seg_end_p = false;
#ifdef BACKGROUND_GC
int cookie = -1;
#endif //BACKGROUND_GC
......@@ -16169,21 +16162,13 @@ BOOL gc_heap::a_fit_segment_end_p (int gen_number,
(end - allocated),
gen_number, align_const);
if (grow_heap_segment (seg, (allocated + limit), &hard_limit_short_seg_end_p))
if (grow_heap_segment (seg, (allocated + limit)))
{
goto found_fit;
}
else
{
if (!hard_limit_short_seg_end_p)
{
dprintf (2, ("can't grow segment, doing a full gc"));
*commit_failed_p = TRUE;
}
else
{
assert (heap_hard_limit);
}
*commit_failed_p = TRUE;
}
}
......@@ -17796,6 +17781,7 @@ void gc_heap::balance_heaps (alloc_context* acontext)
ptrdiff_t gc_heap::get_balance_heaps_uoh_effective_budget (int generation_num)
{
#ifndef USE_REGIONS
if (heap_hard_limit)
{
const ptrdiff_t free_list_space = generation_free_list_space (generation_of (generation_num));
......@@ -17807,6 +17793,7 @@ ptrdiff_t gc_heap::get_balance_heaps_uoh_effective_budget (int generation_num)
return free_list_space - allocated;
}
else
#endif // !USE_REGIONS
{
return dd_new_allocation (dynamic_data_of (generation_num));
}
......@@ -2027,7 +2027,7 @@ protected:
PER_HEAP_ISOLATED
bool virtual_alloc_commit_for_heap (void* addr, size_t size, int h_number);
PER_HEAP_ISOLATED
bool virtual_commit (void* address, size_t size, gc_oh_num oh, int h_number=-1, bool* hard_limit_exceeded_p=NULL);
bool virtual_commit (void* address, size_t size, gc_oh_num oh, int h_number=-1);
PER_HEAP_ISOLATED
bool virtual_decommit (void* address, size_t size, gc_oh_num oh, int h_number=-1);
PER_HEAP_ISOLATED
......@@ -2128,7 +2128,7 @@ protected:
BOOL find_card (uint32_t* card_table, size_t& card,
size_t card_word_end, size_t& end_card);
PER_HEAP
BOOL grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool* hard_limit_exceeded_p=NULL);
BOOL grow_heap_segment (heap_segment* seg, uint8_t* high_address);
PER_HEAP
int grow_heap_segment (heap_segment* seg, uint8_t* high_address, uint8_t* old_loc, size_t size, BOOL pad_front_p REQD_ALIGN_AND_OFFSET_DCL);
PER_HEAP
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册