Remove redundant initialization to keep consistent style
In https://github.com/dotnet/runtime/pull/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.
memset (full_gc_counts, 0, sizeof (full_gc_counts));
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
Tagging subscribers to this area: @dotnet/gc See info in area-owners.md if you want to be subscribed.
Issue Details
In https://github.com/dotnet/runtime/pull/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.
memset (full_gc_counts, 0, sizeof (full_gc_counts));
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
| Author: | AaronRobinsonMSFT |
|---|---|
| Assignees: | AaronRobinsonMSFT |
| Labels: |
|
| Milestone: | 8.0.0 |