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] Introduce and use make_unique_xstrdup


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 6/3/19 8:16 PM, Tom Tromey wrote:
Pedro> +/* Dup STR and return a unique_xmalloc_ptr for the result.  */
Pedro> +
Pedro> +static gdb::unique_xmalloc_ptr<char>
Pedro> +make_unique_xstrdup (const char *str)
Pedro> +{
Pedro> +  return gdb::unique_xmalloc_ptr<char> (xstrdup (str));
Pedro> +}
>> 
>> I could 25 spots that could use this, so how about putting it into a
>> header somewhere?  I am happy to convert all the existing uses.

Pedro> Yeah.  I added a bunch of those spots myself, and been meaning to do
Pedro> this.

Pedro> How about this?

Looks good to me, thanks!

Tom


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