From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14933 invoked by alias); 20 Jul 2009 14:57:36 -0000 Received: (qmail 14923 invoked by uid 22791); 20 Jul 2009 14:57:36 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 14:57:28 +0000 Received: (qmail 16177 invoked from network); 20 Jul 2009 14:57:26 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Jul 2009 14:57:26 -0000 From: Vladimir Prus To: gdb-patches@sourceware.org, Tom Tromey Subject: Re: Value reference counting Date: Mon, 20 Jul 2009 15:08:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) References: <20090717184152.GA6863@caradoc.them.org> <200907201013.36183.vladimir@codesourcery.com> <20090720133040.GA2111@caradoc.them.org> In-Reply-To: <20090720133040.GA2111@caradoc.them.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200907201857.28181.vladimir@codesourcery.com> 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/msg00485.txt.bz2 On Monday 20 July 2009 Daniel Jacobowitz wrote: > On Mon, Jul 20, 2009 at 10:13:35AM +0400, Vladimir Prus wrote: > > > + /* The number of references to this value. This initially includes > > > + one reference from the value chain; if release_value is called, > > > + it converts that into a normal reference. */ > > > + int reference_count; > > > }; > > > > I do not fully understand this comment, specifically the "it converts > > that into a normal reference". What is "it", what is "that" and what > > is "normal reference" and where the convention happens? From your email, > > I gather it's intentional that release_value does not have to be changed, > > but I don't understand anything else :-( I am sure it's just me, but > > a better comment would be good. > > "It" is release_value, and "that" is the one reference. Is this > clearer? > > /* The number of references to this value. When a value is created, > the value chain holds a reference, so REFERENCE_COUNT is 1. If > release_value is called, this value is removed from the chain but > the caller of release_value now has a reference to this value. > The caller must arrange for a call to value_free later. */ Thank you, this is now crystal clear! - Volodya