From a4b6e40867eab086a04f571de333fa94307d16ab Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Thu, 30 Mar 2017 10:11:28 -0700 Subject: [PATCH] Fix an issue where the DAC and GC versions of the heap_segment data structure did not agree on the location of the heap field (dotnet/coreclr#10576) Commit migrated from https://github.com/dotnet/coreclr/commit/11f2dbd1d8376358727a686126024984b01e3383 --- src/coreclr/src/gc/gcpriv.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 92868bb..7bd6883 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -4171,12 +4171,11 @@ public: size_t flags; PTR_heap_segment next; uint8_t* background_allocated; - uint8_t* plan_allocated; - uint8_t* saved_bg_allocated; - #ifdef MULTIPLE_HEAPS gc_heap* heap; #endif //MULTIPLE_HEAPS + uint8_t* plan_allocated; + uint8_t* saved_bg_allocated; #ifdef _MSC_VER // Disable this warning - we intentionally want __declspec(align()) to insert padding for us @@ -4196,6 +4195,9 @@ static_assert(offsetof(dac_heap_segment, mem) == offsetof(heap_segment, mem), "D static_assert(offsetof(dac_heap_segment, flags) == offsetof(heap_segment, flags), "DAC heap segment layout mismatch"); static_assert(offsetof(dac_heap_segment, next) == offsetof(heap_segment, next), "DAC heap segment layout mismatch"); static_assert(offsetof(dac_heap_segment, background_allocated) == offsetof(heap_segment, background_allocated), "DAC heap segment layout mismatch"); +#ifdef MULTIPLE_HEAPS +static_assert(offsetof(dac_heap_segment, heap) == offsetof(heap_segment, heap), "DAC heap segment layout mismatch"); +#endif // MULTIPLE_HEAPS inline uint8_t*& heap_segment_reserved (heap_segment* inst) -- 2.7.4