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 4/6] C++ify badness_vector, fix leaks


LGTM, just a tiny comment:

On 2018-10-15 11:11 a.m., Pedro Alves wrote:
> @@ -2848,7 +2842,7 @@ find_overload_match (gdb::array_view<value *> args,
>     contained in QUALIFIED_NAME until it either finds a good match or
>     runs out of namespaces.  It stores the overloaded functions in
>     *OLOAD_SYMS, and the badness vector in *OLOAD_CHAMP_BV.  The
> -   calling function is responsible for freeing *OLOAD_SYMS and
> +   calling function is responsible for clearing *OLOAD_SYMS and
>     *OLOAD_CHAMP_BV.  If NO_ADL, argument dependent lookup is not 
>     performned.  */

The previous comment meant that the caller was responsible to free the data
after this function is called.  From what I understand, the new comment means
the caller is responsible to pass empty vectors as inputs, is that right?  If
so, it would be clearer to say "the calling function is responsible for passing
empty vectors for *OLOAD_SYMS and *OLOAD_CHAMP_BV".

I know the opposite wouldn't really make sense (asking the caller to clear the
vector after the call), but like this it sounds ambiguous.

Simon

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