From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32268 invoked by alias); 16 Nov 2016 23:34:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32259 invoked by uid 89); 16 Nov 2016 23:34:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=noexcept X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Nov 2016 23:34:27 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B386624C8; Wed, 16 Nov 2016 23:34:26 +0000 (UTC) Received: from [127.0.0.1] (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAGNYOlo028026; Wed, 16 Nov 2016 18:34:25 -0500 Subject: Re: [RFA 01/14] Introduce py-ref.h To: Tom Tromey References: <1478497656-11832-1-git-send-email-tom@tromey.com> <1478497656-11832-2-git-send-email-tom@tromey.com> <7df8b22f-cd05-c0d6-5ede-e9dc29bca6e2@redhat.com> <8760nsiozp.fsf@tromey.com> <8760nnqaix.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <4140dbae-6cd8-13bf-3f56-43e1d4c1f2b6@redhat.com> Date: Wed, 16 Nov 2016 23:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <8760nnqaix.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00465.txt.bz2 On 11/16/2016 11:18 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves 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