This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 01/14] Introduce py-ref.h
On 11/16/2016 11:18 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> Since there's no need to worry about noexcept garantees here
> Pedro> (destructing a gdbpy_ref can't throw), I'd rather that
> Pedro> move would not be implemented as a swap, as that extends the
> Pedro> lifetime of m_obj in OTHER.
> [...]
> Pedro> Or perhaps simpler, go with something like what you had in the
> Pedro> first version:
>
> I made this change.
>
> Pedro> But add a "if (this != &other)" check. I'd tweak it to be
> Pedro> in terms of reset() while at it:
>
> I also changed the other operator= to use reset(), and I changed the
> code to use Py_XINCREF rather than a NULL check.
Sounds good.
Thanks,
Pedro Alves