From: Jan Kotas Date: Tue, 4 May 2021 21:58:34 +0000 (-0700) Subject: Fix verifyheap for objects larger than 4GB (#2244) X-Git-Tag: submit/tizen/20210909.063632~15^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ff92e97d38cc8e091d326cb92c73912f6b09a88;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix verifyheap for objects larger than 4GB (#2244) Fixes https://github.com/dotnet/runtime/issues/52233 --- diff --git a/src/SOS/Strike/eeheap.cpp b/src/SOS/Strike/eeheap.cpp index be5e69b51..9651fe234 100644 --- a/src/SOS/Strike/eeheap.cpp +++ b/src/SOS/Strike/eeheap.cpp @@ -1079,7 +1079,7 @@ BOOL GCHeapUsageStats(const GCHeapDetails& heap, BOOL bIncUnreachable, HeapUsage return TRUE; } -DWORD GetNumComponents(TADDR obj) +size_t GetNumComponents(TADDR obj) { // The number of components is always the second pointer in the object. DWORD Value = NULL; diff --git a/src/SOS/Strike/gcroot.cpp b/src/SOS/Strike/gcroot.cpp index 38c64ce4a..aeaa6bfe9 100644 --- a/src/SOS/Strike/gcroot.cpp +++ b/src/SOS/Strike/gcroot.cpp @@ -1072,7 +1072,7 @@ GCRootImpl::RootNode *GCRootImpl::GetGCRefs(RootNode *path, RootNode *node) return refs; } -DWORD GCRootImpl::GetComponents(TADDR obj, TADDR mt) +size_t GCRootImpl::GetComponents(TADDR obj, TADDR mt) { // Get the number of components in the object (for arrays and such). DWORD Value = 0; @@ -1099,7 +1099,7 @@ size_t GCRootImpl::GetSizeOfObject(TADDR obj, MTInfo *info) { // this is an array, so the size has to include the size of the components. We read the number // of components from the target and multiply by the component size to get the size. - DWORD components = GetComponents(obj, info->MethodTable); + size_t components = GetComponents(obj, info->MethodTable); res += info->ComponentSize * components; } diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 277b50274..638d50d0b 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -1806,7 +1806,7 @@ DWORD_PTR LoaderHeapInfo(CLRDATA_ADDRESS pLoaderHeapAddr, DWORD_PTR *wasted = 0) DWORD_PTR JitHeapInfo(); DWORD_PTR VSDHeapInfo(CLRDATA_ADDRESS appDomain, DWORD_PTR *wasted = 0); -DWORD GetNumComponents(TADDR obj); +size_t GetNumComponents(TADDR obj); struct GenUsageStat { @@ -3183,7 +3183,7 @@ private: // Object/MT data: MTInfo *GetMTInfo(TADDR mt); - DWORD GetComponents(TADDR obj, TADDR mt); + size_t GetComponents(TADDR obj, TADDR mt); size_t GetSizeOfObject(TADDR obj, MTInfo *info); // RootNode management: