From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17483 invoked by alias); 17 Jul 2009 19:04:32 -0000 Received: (qmail 17470 invoked by uid 22791); 17 Jul 2009 19:04:29 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Jul 2009 19:04:23 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id DA0D510623; Fri, 17 Jul 2009 19:04:19 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id C456710620; Fri, 17 Jul 2009 19:04:19 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MRsjC-0002S7-O7; Fri, 17 Jul 2009 15:04:18 -0400 Date: Fri, 17 Jul 2009 19:25:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org, Vladimir Prus Subject: Re: Value reference counting Message-ID: <20090717190418.GA9041@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org, Vladimir Prus References: <20090717184152.GA6863@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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 X-SW-Source: 2009-07/txt/msg00437.txt.bz2 On Fri, Jul 17, 2009 at 12:53:52PM -0600, Tom Tromey wrote: > This will work fine for Python. Also, I think that this model is > clearer than what I did. > > It seems to me that at this point, release_value is doing a walk of a > linked list for no particular benefit. Suppose we deleted release_value > and replaced all calls to it with calls to value_incref? > > This might result in some values living slightly longer than they > otherwise would have (they will live until free_all_values, whereas > currently they will be deleted at value_free time, which might or might > not be sooner). > > The only thing I could think of is whether this would affect watchpoint > operation, since IIUC the watchpoint code examines all_values. But, if > this problem exists, it could be worked around by examining the > reference count of values on the chain. > > What do you think? I had a good reason this would leak values for watchpoints, but now I can't get it to work out. Still, it makes me nervous. free_all_values can have a very long interval. But it looks like breakpoint commands always run it, so not unbounded user behavior. What about breakpoint conditions? Is anything released and free'd during a condition check going to linger until we stop? -- Daniel Jacobowitz CodeSourcery