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

Avoid accounting work on 32-bit platforms (#73491)

上级 63b26566
...@@ -22687,17 +22687,20 @@ heap_segment* gc_heap::unlink_first_rw_region (int gen_idx) ...@@ -22687,17 +22687,20 @@ heap_segment* gc_heap::unlink_first_rw_region (int gen_idx)
assert (!heap_segment_read_only_p (region)); assert (!heap_segment_read_only_p (region));
dprintf (REGIONS_LOG, ("unlink_first_rw_region on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region))); dprintf (REGIONS_LOG, ("unlink_first_rw_region on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region)));
#ifdef _DEBUG #if defined(_DEBUG) && defined(HOST_64BIT)
int old_oh = heap_segment_oh (region); if (heap_hard_limit_oh[soh])
int old_heap = heap_segment_heap (region)->heap_number; {
dprintf(3, ("commit-accounting: from %d to temp [%Ix, %Ix) for heap %d", old_oh, get_region_start (region), heap_segment_committed (region), old_heap)); int old_oh = heap_segment_oh (region);
int old_heap = heap_segment_heap (region)->heap_number;
size_t committed = heap_segment_committed (region) - get_region_start (region); dprintf(3, ("commit-accounting: from %d to temp [%Ix, %Ix) for heap %d", old_oh, get_region_start (region), heap_segment_committed (region), old_heap));
check_commit_cs.Enter();
assert (g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] >= committed); size_t committed = heap_segment_committed (region) - get_region_start (region);
g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] -= committed; check_commit_cs.Enter();
check_commit_cs.Leave(); assert (g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] >= committed);
#endif // _DEBUG g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] -= committed;
check_commit_cs.Leave();
}
#endif // _DEBUG && HOST_64BIT
set_heap_for_contained_basic_regions (region, nullptr); set_heap_for_contained_basic_regions (region, nullptr);
...@@ -22721,17 +22724,20 @@ void gc_heap::thread_rw_region_front (int gen_idx, heap_segment* region) ...@@ -22721,17 +22724,20 @@ void gc_heap::thread_rw_region_front (int gen_idx, heap_segment* region)
} }
dprintf (REGIONS_LOG, ("thread_rw_region_front on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region))); dprintf (REGIONS_LOG, ("thread_rw_region_front on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region)));
#ifdef _DEBUG #if defined(_DEBUG) && defined(HOST_64BIT)
int new_oh = gen_to_oh (gen_idx); if (heap_hard_limit_oh[soh])
int new_heap = this->heap_number; {
dprintf(3, ("commit-accounting: from temp to %d [%Ix, %Ix) for heap %d", new_oh, get_region_start (region), heap_segment_committed (region), new_heap)); int new_oh = gen_to_oh (gen_idx);
int new_heap = this->heap_number;
size_t committed = heap_segment_committed (region) - get_region_start (region); dprintf(3, ("commit-accounting: from temp to %d [%Ix, %Ix) for heap %d", new_oh, get_region_start (region), heap_segment_committed (region), new_heap));
check_commit_cs.Enter();
assert (heap_segment_heap (region) == nullptr); size_t committed = heap_segment_committed (region) - get_region_start (region);
g_heaps[new_heap]->committed_by_oh_per_heap[new_oh] += committed; check_commit_cs.Enter();
check_commit_cs.Leave(); assert (heap_segment_heap (region) == nullptr);
#endif // _DEBUG g_heaps[new_heap]->committed_by_oh_per_heap[new_oh] += committed;
check_commit_cs.Leave();
}
#endif // _DEBUG && HOST_64BIT
set_heap_for_contained_basic_regions (region, this); set_heap_for_contained_basic_regions (region, this);
} }
...@@ -44091,6 +44097,7 @@ HRESULT GCHeap::Initialize() ...@@ -44091,6 +44097,7 @@ HRESULT GCHeap::Initialize()
{ {
gc_heap::total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&gc_heap::is_restricted_physical_mem); gc_heap::total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&gc_heap::is_restricted_physical_mem);
} }
gc_heap::heap_hard_limit_oh[soh] = 0;
#ifdef HOST_64BIT #ifdef HOST_64BIT
gc_heap::heap_hard_limit = (size_t)GCConfig::GetGCHeapHardLimit(); gc_heap::heap_hard_limit = (size_t)GCConfig::GetGCHeapHardLimit();
gc_heap::heap_hard_limit_oh[soh] = (size_t)GCConfig::GetGCHeapHardLimitSOH(); gc_heap::heap_hard_limit_oh[soh] = (size_t)GCConfig::GetGCHeapHardLimitSOH();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册