Skip to content

Commit

Permalink
Fix the logic for regions detection (#67979)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Apr 14, 2022
1 parent 32e03eb commit 52ae06e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/coreclr/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2760,18 +2760,18 @@ ClrDataAccess::GetGCHeapStaticData(struct DacpGcHeapDetails *detailsData)
detailsData->card_table = PTR_CDADDR(g_card_table);
detailsData->mark_array = (CLRDATA_ADDRESS)*g_gcDacGlobals->mark_array;
detailsData->next_sweep_obj = (CLRDATA_ADDRESS)*g_gcDacGlobals->next_sweep_obj;
if (g_gcDacGlobals->saved_sweep_ephemeral_seg != nullptr)
{
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)*g_gcDacGlobals->saved_sweep_ephemeral_seg;
detailsData->saved_sweep_ephemeral_start = (CLRDATA_ADDRESS)*g_gcDacGlobals->saved_sweep_ephemeral_start;
}
else
if (IsRegionGCEnabled())
{
// with regions, we don't have these variables anymore
// use special value -1 in saved_sweep_ephemeral_seg to signal the region case
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)-1;
detailsData->saved_sweep_ephemeral_start = 0;
}
else
{
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)*g_gcDacGlobals->saved_sweep_ephemeral_seg;
detailsData->saved_sweep_ephemeral_start = (CLRDATA_ADDRESS)*g_gcDacGlobals->saved_sweep_ephemeral_start;
}
detailsData->background_saved_lowest_address = (CLRDATA_ADDRESS)*g_gcDacGlobals->background_saved_lowest_address;
detailsData->background_saved_highest_address = (CLRDATA_ADDRESS)*g_gcDacGlobals->background_saved_highest_address;

Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/debug/daccess/request_svr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,18 @@ ClrDataAccess::ServerGCHeapDetails(CLRDATA_ADDRESS heapAddr, DacpGcHeapDetails *
detailsData->card_table = (CLRDATA_ADDRESS)pHeap->card_table;
detailsData->mark_array = (CLRDATA_ADDRESS)pHeap->mark_array;
detailsData->next_sweep_obj = (CLRDATA_ADDRESS)pHeap->next_sweep_obj;
if (pHeap->saved_sweep_ephemeral_seg.IsValid())
{
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)dac_cast<TADDR>(pHeap->saved_sweep_ephemeral_seg);
detailsData->saved_sweep_ephemeral_start = (CLRDATA_ADDRESS)pHeap->saved_sweep_ephemeral_start;
}
else
if (IsRegionGCEnabled())
{
// with regions, we don't have these variables anymore
// use special value -1 in saved_sweep_ephemeral_seg to signal the region case
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)-1;
detailsData->saved_sweep_ephemeral_start = 0;
}
else
{
detailsData->saved_sweep_ephemeral_seg = (CLRDATA_ADDRESS)dac_cast<TADDR>(pHeap->saved_sweep_ephemeral_seg);
detailsData->saved_sweep_ephemeral_start = (CLRDATA_ADDRESS)pHeap->saved_sweep_ephemeral_start;
}
detailsData->background_saved_lowest_address = (CLRDATA_ADDRESS)pHeap->background_saved_lowest_address;
detailsData->background_saved_highest_address = (CLRDATA_ADDRESS)pHeap->background_saved_highest_address;

Expand Down

0 comments on commit 52ae06e

Please sign in to comment.