From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23873 invoked by alias); 31 Jan 2015 03:20:56 -0000 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 Received: (qmail 23860 invoked by uid 89); 31 Jan 2015 03:20:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 31 Jan 2015 03:20:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0216D116830; Fri, 30 Jan 2015 22:20:51 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yAusTJ0UjkKP; Fri, 30 Jan 2015 22:20:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 8DBEC11682F; Fri, 30 Jan 2015 22:20:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 9CE0E491CD; Sat, 31 Jan 2015 07:20:46 +0400 (RET) Date: Sat, 31 Jan 2015 20:06:00 -0000 From: Joel Brobecker To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/6] Mention which return values need to be freed in lang_varobj_ops Message-ID: <20150131032046.GQ5193@adacore.com> References: <1422559716-5480-1-git-send-email-simon.marchi@ericsson.com> <1422559716-5480-2-git-send-email-simon.marchi@ericsson.com> <20150130032848.GK5193@adacore.com> <54CBB44C.8040701@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54CBB44C.8040701@ericsson.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-01/txt/msg00810.txt.bz2 > After looking more closely, I think you are right. Originally, I saw that > install_new_value called value_free on the old value and jumped to the > conclusion. Actually, value_free is more like a "value_decref", which > frees the variable if the reference count drops to 0. The call to > value_free just matches the value_incref that was also done in > install_new_value when we installed the value. So just calling > value_of_child doesn't mean that you have to call value_free. Good :). > Thanks for the explanation, I didn't know about the memory management of > values. I'll remove the comment change for value_of_child. Is the rest of > the patch ok? Yes, it is. Go ahead and push the version without this particular comment change. -- Joel