This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Remove unnecessary zero-initializations
Andrew Cagney wrote:
>
> > The fact that 13 files were doing it should suggest that it was
> >> intentional. Might want to wait a bit longer while someone dregs up the
> >> history.
> >
> >
> > Not necessarily. At one time it was required. Then someone
> > (either Stan Shebs or John Metzler, I forget) revamped the way
> > target vectors are created, so that it is no longer required.
> > These may either be legacy, or someone doing the initialization
> > from habit. In any case, it's definitely not required now.
>
> I know it was John Metzler but I don't have the details of what exactly
> he did. Do you?
As I recall, the old method was to malloc the vector and then
explicitly initialize all the members. The new one was to
statically allocate it, so that only the non-zero members
had to be initialized. This was done so that adding new members
would be less painful.