This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/8] Refactor disassembly code


On 2017-01-12 07:36, Pedro Alves wrote:
I had written it that way originally because a default parameter forces
the compiler to pass down an extra parameter (adding to register pressure)
to all call sites, when only a few places actually need the extra
output parameter.  It's like a double-optional -- i.e., the
parameter can be NULL, so merging doesn't simplify that much,
given that the version with the single argument does not need to
check the parameter.  I.e., one function can be built on top of the
other.  I see it as a different case from when a parameter is optional
such that the passed in value always need to be taken in consideration
by the method implementation, like when passing a flags argument, with
the default being some flag value (or zero).

But this is not really performance critical code, so if you
want to change it, I don't mind.

Ok, I hadn't gone that far in my reflexion, I thought it was simply a convenience thing.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]