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

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> I looked at this more and found that free_command_lines was indeed
Simon> being called when the shared_ptr free'd its pointer.  I finally
Simon> understood that when assigning:
Simon>   a_shared_ptr = a_unique_ptr;
Simon> like commands_command_1 does, for example, the deleter is also
Simon> transferred.

Yeah, I should probably have mentioned that.  I had to read about it
too, but then I think I had forgotten about it by the time I sent the
patch.  I don't really understand why unique_ptr and shared_ptr differ
in this way; if you know the rationale I'd be interested in learning it.

Tom


  reply	other threads:[~2017-09-02 15:31 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 2/3] Use function_view in a couple of places " 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
2017-09-02 15:31       ` Tom Tromey [this message]
2017-09-02 18:22         ` Simon Marchi
2017-09-21  3:52           ` Tom Tromey
2017-08-30 22:06 ` [RFA 1/3] Allocate bpstats with new 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=87y3px2l7p.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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