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: [RFA 3/3] Change counted_command_line to a shared_ptr


>>>>> "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


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