@@ -22687,17 +22687,20 @@ heap_segment* gc_heap::unlink_first_rw_region (int gen_idx)
22687
22687
assert (!heap_segment_read_only_p (region));
22688
22688
dprintf (REGIONS_LOG, ("unlink_first_rw_region on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region)));
22689
22689
22690
- #ifdef _DEBUG
22691
- int old_oh = heap_segment_oh (region);
22692
- int old_heap = heap_segment_heap (region)->heap_number;
22693
- 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));
22694
-
22695
- size_t committed = heap_segment_committed (region) - get_region_start (region);
22696
- check_commit_cs.Enter();
22697
- assert (g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] >= committed);
22698
- g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] -= committed;
22699
- check_commit_cs.Leave();
22700
- #endif // _DEBUG
22690
+ #if defined(_DEBUG) && defined(HOST_64BIT)
22691
+ if (heap_hard_limit_oh[soh])
22692
+ {
22693
+ int old_oh = heap_segment_oh (region);
22694
+ int old_heap = heap_segment_heap (region)->heap_number;
22695
+ 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));
22696
+
22697
+ size_t committed = heap_segment_committed (region) - get_region_start (region);
22698
+ check_commit_cs.Enter();
22699
+ assert (g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] >= committed);
22700
+ g_heaps[old_heap]->committed_by_oh_per_heap[old_oh] -= committed;
22701
+ check_commit_cs.Leave();
22702
+ }
22703
+ #endif // _DEBUG && HOST_64BIT
22701
22704
22702
22705
set_heap_for_contained_basic_regions (region, nullptr);
22703
22706
@@ -22721,17 +22724,20 @@ void gc_heap::thread_rw_region_front (int gen_idx, heap_segment* region)
22721
22724
}
22722
22725
dprintf (REGIONS_LOG, ("thread_rw_region_front on heap: %d gen: %d region: %Ix", heap_number, gen_idx, heap_segment_mem (region)));
22723
22726
22724
- #ifdef _DEBUG
22725
- int new_oh = gen_to_oh (gen_idx);
22726
- int new_heap = this->heap_number;
22727
- 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));
22728
-
22729
- size_t committed = heap_segment_committed (region) - get_region_start (region);
22730
- check_commit_cs.Enter();
22731
- assert (heap_segment_heap (region) == nullptr);
22732
- g_heaps[new_heap]->committed_by_oh_per_heap[new_oh] += committed;
22733
- check_commit_cs.Leave();
22734
- #endif // _DEBUG
22727
+ #if defined(_DEBUG) && defined(HOST_64BIT)
22728
+ if (heap_hard_limit_oh[soh])
22729
+ {
22730
+ int new_oh = gen_to_oh (gen_idx);
22731
+ int new_heap = this->heap_number;
22732
+ 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));
22733
+
22734
+ size_t committed = heap_segment_committed (region) - get_region_start (region);
22735
+ check_commit_cs.Enter();
22736
+ assert (heap_segment_heap (region) == nullptr);
22737
+ g_heaps[new_heap]->committed_by_oh_per_heap[new_oh] += committed;
22738
+ check_commit_cs.Leave();
22739
+ }
22740
+ #endif // _DEBUG && HOST_64BIT
22735
22741
22736
22742
set_heap_for_contained_basic_regions (region, this);
22737
22743
}
@@ -44091,6 +44097,7 @@ HRESULT GCHeap::Initialize()
44091
44097
{
44092
44098
gc_heap::total_physical_mem = GCToOSInterface::GetPhysicalMemoryLimit (&gc_heap::is_restricted_physical_mem);
44093
44099
}
44100
+ gc_heap::heap_hard_limit_oh[soh] = 0;
44094
44101
#ifdef HOST_64BIT
44095
44102
gc_heap::heap_hard_limit = (size_t)GCConfig::GetGCHeapHardLimit();
44096
44103
gc_heap::heap_hard_limit_oh[soh] = (size_t)GCConfig::GetGCHeapHardLimitSOH();
0 commit comments