From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21305 invoked by alias); 20 Jul 2009 13:30:49 -0000 Received: (qmail 21295 invoked by uid 22791); 20 Jul 2009 13:30:49 -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; Mon, 20 Jul 2009 13:30:43 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id DBFE510B04; Mon, 20 Jul 2009 13:30:41 +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 C454510A63; Mon, 20 Jul 2009 13:30:41 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MSswy-0000fv-8u; Mon, 20 Jul 2009 09:30:40 -0400 Date: Mon, 20 Jul 2009 13:40:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: Value reference counting Message-ID: <20090720133040.GA2111@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb-patches@sourceware.org, Tom Tromey References: <20090717184152.GA6863@caradoc.them.org> <200907201013.36183.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907201013.36183.vladimir@codesourcery.com> 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/msg00474.txt.bz2 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. */ -- Daniel Jacobowitz CodeSourcery