Skip to content

Remove redundant initialization to keep consistent style #75893

Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions