In #74363, an inconsistency was introduced in gc.cpp with respect to initialization. This inconsistency is related to use of {} vs memset. This was done to remove UB with using memset on non-trivial types, in this case containing a user defined constructor. This introduced a regression due to how some constructors were defined, but also introduced inconsistent style. We should remove this inconsistency since these fields are static anyways and will be properly initialized during library load.
last_ephemeral_gc_info = {};
last_full_blocking_gc_info = {};
#ifdef BACKGROUND_GC
memset (&last_bgc_info, 0, sizeof (last_bgc_info));
#endif //BACKGROUND_GC
/cc @dotnet/gc
In #74363, an inconsistency was introduced in
gc.cppwith respect to initialization. This inconsistency is related to use of{}vsmemset. This was done to remove UB with usingmemseton non-trivial types, in this case containing a user defined constructor. This introduced a regression due to how some constructors were defined, but also introduced inconsistent style. We should remove this inconsistency since these fields are static anyways and will be properly initialized during library load.last_ephemeral_gc_info = {}; last_full_blocking_gc_info = {}; #ifdef BACKGROUND_GC memset (&last_bgc_info, 0, sizeof (last_bgc_info)); #endif //BACKGROUND_GC/cc @dotnet/gc