Re: Rethinking *_destroy()
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 19 Sep 2011 22:08:22 +0000 (18:08 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:28 +0000 (09:39 -0800)
77/611c6b00baf70169ebb91b2bf7317eb0b4eba4 [new file with mode: 0644]

diff --git a/77/611c6b00baf70169ebb91b2bf7317eb0b4eba4 b/77/611c6b00baf70169ebb91b2bf7317eb0b4eba4
new file mode 100644 (file)
index 0000000..010e5c0
--- /dev/null
@@ -0,0 +1,83 @@
+Return-Path: <bgamari.foss@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D10A7431FD0\r
+       for <notmuch@notmuchmail.org>; Mon, 19 Sep 2011 15:08:28 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=unavailable\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7lgB4l+649YM for <notmuch@notmuchmail.org>;\r
+       Mon, 19 Sep 2011 15:08:28 -0700 (PDT)\r
+Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com\r
+       [209.85.216.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 9BFA8431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 19 Sep 2011 15:08:28 -0700 (PDT)\r
+Received: by qyk30 with SMTP id 30so3082432qyk.5\r
+       for <notmuch@notmuchmail.org>; Mon, 19 Sep 2011 15:08:26 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type;\r
+       bh=oqVWSie3FLajSgHwJpSLiFkXhwqnimbp1emmtrVg6d8=;\r
+       b=ObDq3xRFEzEoC3YO/IeJ87Y2AP1s0K3GSv3/DRdhCWP51u3H3BzVTCtoWCR2oMMLYO\r
+       fCiouDHIuWcunvs6jQWm1mp/Tey3iivkJby8TCNyUybqEeUSb6m0dqDMI18kXgsgluVL\r
+       4k8ClyAlcIeMsrJTCzpKbv5tSk4GqXsMl698A=\r
+Received: by 10.224.202.135 with SMTP id fe7mr10798qab.378.1316470106775;\r
+       Mon, 19 Sep 2011 15:08:26 -0700 (PDT)\r
+Received: from localhost (pool-96-233-180-23.spfdma.east.verizon.net.\r
+       [96.233.180.23])\r
+       by mx.google.com with ESMTPS id hc5sm6238550qab.23.2011.09.19.15.08.24\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 19 Sep 2011 15:08:25 -0700 (PDT)\r
+From: Ben Gamari <bgamari.foss@gmail.com>\r
+To: notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: Rethinking *_destroy()\r
+In-Reply-To: <87aaa0l1tc.fsf@gmail.com>\r
+References: <87aaa0l1tc.fsf@gmail.com>\r
+User-Agent: Notmuch/0.7-37-g5c3c7f6 (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 19 Sep 2011 18:08:22 -0400\r
+Message-ID: <87sjnsrxrd.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: Bertram Felgenhauer <bertram.felgenhauer@googlemail.com>,\r
+       Bart Massey <bart@cs.pdx.edu>, Austin Clements <amdragon@MIT.EDU>,\r
+       notmuch <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 19 Sep 2011 22:08:29 -0000\r
+\r
+On Mon, 19 Sep 2011 16:22:39 -0400, Ben Gamari <bgamari.foss@gmail.com> wrote:\r
+> I can see at least two ways of doing this,\r
+> \r
+>   1) Acknowledging that we use talloc and allowing users to use\r
+>      talloc_ref and talloc_unlink directly\r
+> \r
+>   2) Wrapping talloc by adding a *_ref() and *_unref() to each object\r
+> \r
+I should not that these aren't quite as trivial as they sound. As I\r
+neglect to mention in this message, we currently use talloc_free in\r
+*_destroy(). As of talloc-2.0, talloc_free() fails on objects with more\r
+than one parent. When we allow library users to add their own references\r
+to notmuch objects, this assumption will break. Sorry for the confusion,\r
+\r
+Cheers,\r
+\r
+- Ben\r