From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: "vries@gcc.gnu.org" <vries@gcc.gnu.org>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v3] gdb: c++ify btrace_target_info
Date: Mon, 11 Sep 2023 06:18:54 +0000 [thread overview]
Message-ID: <DM8PR11MB5749F8FE04C49C5E88629A47DEF2A@DM8PR11MB5749.namprd11.prod.outlook.com> (raw)
In-Reply-To: <0d7782da-940c-40da-a511-4f8a36b5455c@polymtl.ca>
Hello Simon,
>> - gdb::unique_xmalloc_ptr<btrace_target_info> tinfo
>> - (XCNEW (btrace_target_info));
>> - tinfo->ptid = ptid;
>> + std::unique_ptr<linux_btrace_target_info> tinfo
>> + { new linux_btrace_target_info { ptid } };
>
>We recently added a gdb::make_unique function, it would make sense to
>you use it here (it will eventually become std::make_unique once we
>migrate to C++ 14).
>
>So this could be written as:
>
> auto tinfo = gdb::make_unique<linux_btrace_target_info> (ptid);
I'm not a fan of 'auto'. So this becomes
std::unique_ptr<linux_btrace_target_info> tinfo
{ gdb::make_unique<linux_btrace_target_info> (ptid) };
>Approved-By: Simon Marchi <simon.marchi@efficios.com>
Pushed.
thanks,
markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2023-09-11 6:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 10:53 Markus Metzger
2023-09-08 14:31 ` Simon Marchi
2023-09-11 6:18 ` Metzger, Markus T [this message]
2023-09-11 9:17 ` Andrew Burgess
2023-09-11 9:53 ` Metzger, Markus T
2023-09-11 14:25 ` Andrew Burgess
2023-09-11 15:27 ` Simon Marchi
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=DM8PR11MB5749F8FE04C49C5E88629A47DEF2A@DM8PR11MB5749.namprd11.prod.outlook.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=vries@gcc.gnu.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).