From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0A4DE431FAF for ; Mon, 24 Dec 2012 12:32:54 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tz2Cug1cLpnP for ; Mon, 24 Dec 2012 12:32:52 -0800 (PST) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 92296431FAE for ; Mon, 24 Dec 2012 12:32:52 -0800 (PST) X-AuditID: 12074422-b7f616d000000e7c-4d-50d8bbf3b157 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id B4.AF.03708.3FBB8D05; Mon, 24 Dec 2012 15:32:51 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id qBOKWojZ012582; Mon, 24 Dec 2012 15:32:50 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBOKWlIe027329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 24 Dec 2012 15:32:48 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1TnEhb-0008LK-59; Mon, 24 Dec 2012 15:32:47 -0500 From: Austin Clements To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [PATCH] _notmuch_message_index_file: unref (free) address lists from gmime. In-Reply-To: <1355196820-29734-1-git-send-email-david@tethera.net> References: <1355188740-6663-1-git-send-email-david@tethera.net> <1355196820-29734-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.14+236~gf64406d (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Mon, 24 Dec 2012 15:32:46 -0500 Message-ID: <87txrbkx75.fsf@awakening.csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsUixCmqrft5940Ag47XfBYbl/1ktrjR2s1o cf3mTGYHZo9fbXOZPZ6tusXsseXQe+YA5igum5TUnMyy1CJ9uwSujIbLp9gKmngrXt/cwNrA eICri5GTQ0LARGLHjytMELaYxIV769m6GLk4hAT2MUpMmX2VGcLZwCjRf3onVOYik8Snyc+Z IJwljBI9bbdYQfrZBPQlVqydBGRzcIgI6Eks3CoDEmYWUJOYtOYMO4gtLBAhcb1rHpjNKeAk 0dF9kxnEFhIok5h1cTqYLSoQL/H83jcWEJtFQFXi1+KpYCN5gU69OgEszCsgKHFy5hMWiPFa Ejf+vWSawCg4C0lqFpLUAkamVYyyKblVurmJmTnFqcm6xcmJeXmpRbqmermZJXqpKaWbGEHB y+6itIPx50GlQ4wCHIxKPLwFk28ECLEmlhVX5h5ilORgUhLl9d0FFOJLyk+pzEgszogvKs1J LT7EKMHBrCTCy70OKMebklhZlVqUD5OS5mBREue9lnLTX0ggPbEkNTs1tSC1CCYrw8GhJMF7 EWSoYFFqempFWmZOCUKaiYMTZDgP0PBlIDW8xQWJucWZ6RD5U4yKUuK8LSAJAZBERmkeXC8s ubxiFAd6RZi3HqSKB5iY4LpfAQ1mAhocywc2uCQRISXVwNg584nWnqan9+ZbnDr95+05gfOv vLUuPLCqS/64+OkTuzfO3+bMKpLb4asjIHbgpJaphrZpfsAcjq5/K+xMJHyNkzMD3zzK9Mj6 UZTkX152VniVTlLb/KDYy8/uqc1xrulqCU7P3u2Z/+PMrt8dLlo+Zhfuzdpjyyby9+/mljDu lTf+3HpyS1KJpTgj0VCLuag4EQDfwg6GCQMAAA== Cc: David Bremner X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2012 20:32:54 -0000 This patch LGTM. On Mon, 10 Dec 2012, david@tethera.net wrote: > From: David Bremner > > Apparently as of GMime 2.4, you don't need to call > internet_address_list_destroy anymore, but you still need to call > g_object_unref (from the GMime Changelog). > > On the medium performance corpus, valgrind shows "possibly lost" > leakage in "notmuch new" dropping from 7M to 300k. > --- > lib/index.cc | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/lib/index.cc b/lib/index.cc > index da0e6ce..a2edd6d 100644 > --- a/lib/index.cc > +++ b/lib/index.cc > @@ -484,12 +484,18 @@ mboxes is deprecated and may be removed in the future.\n", filename); > } > > from = g_mime_message_get_sender (mime_message); > - addresses = internet_address_list_parse_string (from); > > - _index_address_list (message, "from", addresses); > + addresses = internet_address_list_parse_string (from); > + if (addresses) { > + _index_address_list (message, "from", addresses); > + g_object_unref (addresses); > + } > > addresses = g_mime_message_get_all_recipients (mime_message); > - _index_address_list (message, "to", addresses); > + if (addresses) { > + _index_address_list (message, "to", addresses); > + g_object_unref (addresses); > + } > > subject = g_mime_message_get_subject (mime_message); > _notmuch_message_gen_terms (message, "subject", subject); > -- > 1.7.10.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch