Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C607F431FD0 for ; Wed, 7 Sep 2011 13:36:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=unavailable 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 kBU0wLyPsP7U for ; Wed, 7 Sep 2011 13:36:14 -0700 (PDT) Received: from mail-qw0-f41.google.com (mail-qw0-f41.google.com [209.85.216.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 917A0431FB6 for ; Wed, 7 Sep 2011 13:36:14 -0700 (PDT) Received: by qwa26 with SMTP id 26so54073qwa.28 for ; Wed, 07 Sep 2011 13:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=8O53PxPrLOLTeQAvEF0cEkXAzLmFBwOJXXwpQHGIzLw=; b=KHlQVwQ1pmceDfIQXw9u6V8INmmm0yR+kq1RLrVGrKQVxCqlPMh6ezCg9yh+pfK0b0 zCer2SNCvhvG+0PSYF7QP7yiLKHu2makG9wt6bFOjf9Hyx128z0Zv7cfBLmi2KihAcmN lovEf/w4YS250EL9owaYVP66bMFgdf9HT6QDc= Received: by 10.224.184.12 with SMTP id ci12mr5207760qab.270.1315427772596; Wed, 07 Sep 2011 13:36:12 -0700 (PDT) Received: from localhost (pool-96-233-180-23.spfdma.east.verizon.net. [96.233.180.23]) by mx.google.com with ESMTPS id dh6sm1205141qab.0.2011.09.07.13.36.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Sep 2011 13:36:10 -0700 (PDT) From: Ben Gamari To: notmuch , Carl Worth Subject: Re: Memory management practices In-Reply-To: <87liucyn7i.fsf@gmail.com> References: <8739h1pbaq.fsf@gmail.com> <87pqjprzu2.fsf@gmail.com> <20110829183010.GA2605@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> <87liucyn7i.fsf@gmail.com> User-Agent: Notmuch/0.7-37-g5c3c7f6 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Wed, 07 Sep 2011 16:36:08 -0400 Message-ID: <87aaag3xaf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Bertram Felgenhauer , Bart Massey 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: Wed, 07 Sep 2011 20:36:14 -0000 On Mon, 29 Aug 2011 16:30:57 -0400, Ben Gamari wrote: > [SNIP] > > In general, it seems to me that memory management in notmuch bindings is > a little bit harder than it needs to me due to the decision not to > talloc_ref parent objects when a new child object is created. This means > that a bindings author needs to recreate the ownership tree in their > binding, a task which is fairly easily done (except in the case of > Haskell due to the weak GC finalization guarantees) but seems quite > unnecessary. Is there a reason this decision was made? Would a patch be > accepted adding talloc_ref'ing parents in those functions creating > children and talloc_frees in *_destroys? > Any opinions concerning whether this is an acceptable idea? I wouldn't mind putting together a patch-set, but I'd rather not waste my time if the set would ultimately be rejected due to some technical objection I have yet to think of. Cheers, - Ben