From b7eaadf9d17ba0ee26b443399679268ffc1b0b47 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Tue, 20 Sep 2022 12:44:26 -0700 Subject: [PATCH 1/2] Revert previous changes to gc.cpp and make class Volatile have a default ctor --- src/coreclr/gc/env/volatile.h | 4 +--- src/coreclr/gc/gc.cpp | 6 +++--- src/coreclr/gc/gcpriv.h | 2 -- src/coreclr/inc/volatile.h | 5 +---- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/coreclr/gc/env/volatile.h b/src/coreclr/gc/env/volatile.h index fb8a42a6cdc2b..bef01f680e546 100644 --- a/src/coreclr/gc/env/volatile.h +++ b/src/coreclr/gc/env/volatile.h @@ -304,9 +304,7 @@ class Volatile // // Default constructor. // - inline Volatile() : m_val {} - { - } + inline Volatile() = default; // // Allow initialization of Volatile from a T diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 959b3b013d42d..b2ca640d7c9f3 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -13667,8 +13667,8 @@ gc_heap::init_semi_shared() memset (full_gc_counts, 0, sizeof (full_gc_counts)); - last_ephemeral_gc_info = {}; - last_full_blocking_gc_info = {}; + memset (&last_ephemeral_gc_info, 0, sizeof (last_ephemeral_gc_info)); + memset (&last_full_blocking_gc_info, 0, sizeof (last_full_blocking_gc_info)); #ifdef BACKGROUND_GC memset (&last_bgc_info, 0, sizeof (last_bgc_info)); #endif //BACKGROUND_GC @@ -28765,7 +28765,7 @@ uint8_t* gc_heap::find_next_marked (uint8_t* x, uint8_t* end, #ifdef FEATURE_EVENT_TRACE void gc_heap::init_bucket_info() { - *bucket_info = {}; + memset (bucket_info, 0, sizeof (bucket_info)); } void gc_heap::add_plug_in_condemned_info (generation* gen, size_t plug_size) diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index 8cea1afa29230..262a2c27e7c99 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -648,8 +648,6 @@ struct etw_bucket_info uint32_t count; size_t size; - etw_bucket_info() = default; - void set (uint16_t _index, uint32_t _count, size_t _size) { index = _index; diff --git a/src/coreclr/inc/volatile.h b/src/coreclr/inc/volatile.h index 096baadd7743c..177c4932166c6 100644 --- a/src/coreclr/inc/volatile.h +++ b/src/coreclr/inc/volatile.h @@ -344,10 +344,7 @@ class Volatile // // Default constructor. // - inline Volatile() : m_val {} - { - STATIC_CONTRACT_SUPPORTS_DAC; - } + inline Volatile() = default; // // Allow initialization of Volatile from a T From b5b1aa43087849d6ba42d713fadaf8181ac73b26 Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Wed, 21 Sep 2022 06:37:59 -0700 Subject: [PATCH 2/2] Remove unnecessary use of memset --- src/coreclr/gc/gc.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index b2ca640d7c9f3..4d4bbb929a10f 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -13667,12 +13667,6 @@ gc_heap::init_semi_shared() memset (full_gc_counts, 0, sizeof (full_gc_counts)); - memset (&last_ephemeral_gc_info, 0, sizeof (last_ephemeral_gc_info)); - memset (&last_full_blocking_gc_info, 0, sizeof (last_full_blocking_gc_info)); -#ifdef BACKGROUND_GC - memset (&last_bgc_info, 0, sizeof (last_bgc_info)); -#endif //BACKGROUND_GC - should_expand_in_full_gc = FALSE; #ifdef FEATURE_LOH_COMPACTION