From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26197 invoked by alias); 18 May 2012 19:44:24 -0000 Received: (qmail 26188 invoked by uid 22791); 18 May 2012 19:44:24 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 May 2012 19:44:09 +0000 X-Loopcount0: from 10.175.216.251 From: To: CC: Subject: Re: Will therefore GDB utilize C++ or not? Date: Fri, 18 May 2012 19:44:00 -0000 Message-ID: References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <4F832D5B.9030308@redhat.com> <20120409190519.GA524@host2.jankratochvil.net> <4F833D29.4050102@redhat.com> <20120416065456.GA30097@host2.jankratochvil.net> <4F8ECB72.70708@redhat.com> <20120418151553.GA16768@host2.jankratochvil.net> <4F8EDD7B.2010602@redhat.com> <20120418155354.GA17912@host2.jankratochvil.net> <201204181748.q3IHm1cF002815@new.toad.com> <87pqb4q2on.fsf@fleche.redhat.com> <201204182309.q3IN9FcF019607@new.toad.com> <87k409gwv0.fsf@fleche.redhat.com> <35C0C41D-6D07-4612-B0C5-DB00CFD2F975@dell.com> <87zk95fg8c.fsf@fleche.redhat.com> In-Reply-To: <87zk95fg8c.fsf@fleche.redhat.com> Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00091.txt.bz2 On May 18, 2012, at 3:20 PM, Tom Tromey wrote: >>>>>> "Paul" =3D=3D writes: >=20 > Tom> For example, look at the Python layer. Despite patch review and our > Tom> knowledge of the issues, we still have error-checking and > Tom> reference-counting bugs in the code. You can go through the list > Tom> archives and find them. >=20 > Paul> How would C++ help with reference counting bugs? I could see how it > Paul> might (or might not) help with the subset related to error handling > Paul> that can be made clearer with exceptions. But the reference counti= ng > Paul> errors I remember were straight algorithmic mistakes that, as far a= s I > Paul> can see, would have existed in the exact same form if the algorithm > Paul> had been expressed in C++. >=20 > We'd use RAII to ensure that refcounts were automatically managed by the > C++ compiler. That would be nice if the Python ABI is compatible with this. It may not b= e, or not always. For example, when some calls steal a reference while oth= ers (most of them) don't, and some return a borrowed reference while others= return a new one, it isn't clear how a mechanical scheme like RAII will gi= ve you a full answer. Maybe if you use only the subset that does reference= counting in the one way you want it done? There would be some performance= impact but probably not much. paul