From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17939 invoked by alias); 21 Jul 2009 18:13:47 -0000 Received: (qmail 17928 invoked by uid 22791); 21 Jul 2009 18:13:46 -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; Tue, 21 Jul 2009 18:13:41 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 457CF10B04; Tue, 21 Jul 2009 18:13:39 +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 E1ABA10A63; Tue, 21 Jul 2009 18:13:38 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MTJqL-0003N2-Iw; Tue, 21 Jul 2009 14:13:37 -0400 Date: Tue, 21 Jul 2009 18:18:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Cc: Tom Tromey , Vladimir Prus Subject: Re: Value reference counting Message-ID: <20090721181337.GC11667@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org, Tom Tromey , 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: <20090717184152.GA6863@caradoc.them.org> 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/msg00520.txt.bz2 On Fri, Jul 17, 2009 at 02:41:53PM -0400, Daniel Jacobowitz wrote: > This patch, based on an old patch from Vladimir, implements reference > counting for values. Tom, this is the approach I discussed with you > on IRC: instead of treating the value chain as a normal reference and > using release_value to take references, this separates the value chain > (which is boolean; a value is either on it or not) from references > (which are counted). So you take a reference with value_incref. > release_value transforms the value chain's reference into a normal > reference. That's an entirely theoretical operation, by which I mean > release_value doesn't have to do anything special. > > Does this look OK? Tom, will it work for the Python code? > > Tested on x86_64-linux, no regressions. I've checked this in with the revised comment. The long-lived memory usage issues Thiago commented on aren't related particularly to this patch. -- Daniel Jacobowitz CodeSourcery