Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor handling of non-SOH generations #1688

Merged
merged 12 commits into from
Jan 29, 2020
4 changes: 2 additions & 2 deletions src/coreclr/src/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ ClrDataAccess::GetThreadAllocData(CLRDATA_ADDRESS addr, struct DacpAllocData *da
Thread* thread = PTR_Thread(TO_TADDR(addr));

data->allocBytes = TO_CDADDR(thread->m_alloc_context.alloc_bytes);
data->allocBytesLoh = TO_CDADDR(thread->m_alloc_context.alloc_bytes_loh);
data->allocBytesLoh = TO_CDADDR(thread->m_alloc_context.alloc_bytes_uoh);
Copy link
Member

@Maoni0 Maoni0 Jan 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to rename this allocBytesLoh field? this GetThreadAllocData is only used by sos I think (not by clrmd?)? @leculver @mikem8361 could you please confirm? for context we are renaming the alloc_bytes_loh field on the alloc_context to alloc_bytes_uoh because we are introducing a concept of uoh which includes loh and additional generations. #Resolved

Copy link
Member

@mikem8361 mikem8361 Jan 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like SOS doesn't use this API. Not sure about CLRMD. #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am suggesting changing this only when clients can use it. No benefit from changing this now, for sure, since there is still only loh in this change, but we may break something.


In reply to: 368189692 [](ancestors = 368189692)

Copy link
Member Author

@VSadov VSadov Jan 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a tracking bug to revisit this - https://github.com/dotnet/coreclr/issues/27692


In reply to: 368208096 [](ancestors = 368208096,368189692)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ClrMD we reimplement all of this interface in C#. Changing names won't affect us at all, but we require these structures do not change in layout or meaning for backwards compat.

When real changes go in that affect the underlying shape of the GC heap and/or requires changing the shape or usage of DAC data structures it's best to implement a new interface (ISOSDacX or similar) that we can query for to tell us there's a new style of heap involved.


SOSDacLeave();
return hr;
Expand Down Expand Up @@ -732,7 +732,7 @@ ClrDataAccess::GetHeapAllocData(unsigned int count, struct DacpGenerationAllocDa
{
dac_generation entry = *GenerationTableIndex(table, i);
data[0].allocData[i].allocBytes = (CLRDATA_ADDRESS)(ULONG_PTR) entry.allocation_context.alloc_bytes;
data[0].allocData[i].allocBytesLoh = (CLRDATA_ADDRESS)(ULONG_PTR) entry.allocation_context.alloc_bytes_loh;
data[0].allocData[i].allocBytesLoh = (CLRDATA_ADDRESS)(ULONG_PTR) entry.allocation_context.alloc_bytes_uoh;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/debug/daccess/request_svr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ HRESULT ClrDataAccess::GetServerAllocData(unsigned int count, struct DacpGenerat
{
dac_generation generation = *ServerGenerationTableIndex(pHeap, i);
data[n].allocData[i].allocBytes = (CLRDATA_ADDRESS)(ULONG_PTR) generation.allocation_context.alloc_bytes;
data[n].allocData[i].allocBytesLoh = (CLRDATA_ADDRESS)(ULONG_PTR) generation.allocation_context.alloc_bytes_loh;
data[n].allocData[i].allocBytesLoh = (CLRDATA_ADDRESS)(ULONG_PTR) generation.allocation_context.alloc_bytes_uoh;
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/src/gc/env/gcenv.base.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#define NOINLINE __declspec(noinline)
#endif // _MSC_VER

#ifdef _MSC_VER
#define __UNREACHABLE() __assume(0)
#else
#define __UNREACHABLE() __builtin_unreachable()
#endif

#ifndef SIZE_T_MAX
#define SIZE_T_MAX ((size_t)-1)
#endif
Expand Down
Loading