Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Change counted_command_line to a shared_ptr
Date: Sat, 02 Sep 2017 10:48:00 -0000	[thread overview]
Message-ID: <843aefc2fa977bad3d4b0e88dc0488de@polymtl.ca> (raw)
In-Reply-To: <13f5b277e2bc200beafe7304791c32f5@polymtl.ca>

On 2017-09-01 22:48, Simon Marchi wrote:
> On 2017-08-31 00:06, Tom Tromey wrote:
>> This changes counted_command_line to be a typedef for std::shared_ptr
>> and removes the associated cleanups.  In the long run I believe that
>> cmd_list_element should also be changed to use a shared_ptr.
> 
> The command_line object is currently freed using free_command_lines.
> The shared_ptr will "delete" it.  It seems to me that some
> C++ification of the command_line structure needs to happen for it to
> get de-allocated properly.

Hi Tom,

I looked at this more and found that free_command_lines was indeed being 
called when the shared_ptr free'd its pointer.  I finally understood 
that when assigning:

   a_shared_ptr = a_unique_ptr;

like commands_command_1 does, for example, the deleter is also 
transferred.

Simon


  reply	other threads:[~2017-09-02 10:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 22:06 [RFA 0/3] some C++-ification in breakpoint.c Tom Tromey
2017-08-30 22:06 ` [RFA 1/3] Allocate bpstats with new Tom Tromey
2017-08-30 22:06 ` [RFA 3/3] Change counted_command_line to a shared_ptr Tom Tromey
2017-09-01 20:48   ` Simon Marchi
2017-09-02 10:48     ` Simon Marchi [this message]
2017-09-02 15:31       ` Tom Tromey
2017-09-02 18:22         ` Simon Marchi
2017-09-21  3:52           ` Tom Tromey
2017-08-30 22:06 ` [RFA 2/3] Use function_view in a couple of places in breakpoint.c Tom Tromey

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=843aefc2fa977bad3d4b0e88dc0488de@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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