Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Simon Marchi <simark@simark.ca>, Tom Tromey <tromey@adacore.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 0/2] More uses of make_unique_xstrdup
Date: Thu, 15 Jan 2026 15:16:01 -0300	[thread overview]
Message-ID: <71d9340d-e7a8-45e3-99f6-d0ec02cb2d23@redhat.com> (raw)
In-Reply-To: <9d7acb9f-9dad-45fe-8ea9-8793e8177264@simark.ca>

On 1/15/26 3:01 PM, Simon Marchi wrote:
> On 1/15/26 12:39 PM, Guinevere Larsen wrote:
>> On 1/15/26 2:33 PM, Tom Tromey wrote:
>>> This replaces some uses of '.reset(xstrdup())' with
>>> '= make_unique_xstrdup()'.  I think explicit uses of reset
>>> should be avoided when possible.
>>>
>>> Regression tested on x86-64 Fedora 41.
>>>
>>> Signed-off-by: Tom Tromey <tromey@adacore.com>
>> This makes me wonder... is there any reason to prefer xmalloc/xstrdup instead of using std::string?
>>
>> My preference is to use stdlib stuff when possible, but maybe I'm misjudging the size of the refactor or there's a reason to prefer the current memory strategy.
> When practical to switch to std::string, it typically is an improvement.
> It makes strings manipulation safer and clearer.  There might be cases
> where it is not trivial to use std::string immediately though, so
> switching to make_unique_xstrdup is a good incremental change
> nonetheless.
>
> Simon
>
Right that makes sense. I was moreso double-checking my gut feeling, 
rather than asserting that the series should convert to std::string

-- 
Cheers,
Guinevere Larsen
It/she


  reply	other threads:[~2026-01-15 18:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 17:33 Tom Tromey
2026-01-15 17:33 ` [PATCH 1/2] Use make_unique_xstrdup in more places Tom Tromey
2026-01-15 17:33 ` [PATCH 2/2] Use make_unique_xstrdup in tracepoint Tom Tromey
2026-01-15 17:39 ` [PATCH 0/2] More uses of make_unique_xstrdup Guinevere Larsen
2026-01-15 18:01   ` Simon Marchi
2026-01-15 18:16     ` Guinevere Larsen [this message]
2026-01-16 14:14 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71d9340d-e7a8-45e3-99f6-d0ec02cb2d23@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox