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 03A16431FBC for ; Mon, 6 Oct 2014 06:25:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 H0G0NqVMORpg for ; Mon, 6 Oct 2014 06:25:20 -0700 (PDT) Received: from outgoing.csail.mit.edu (outgoing.csail.mit.edu [128.30.2.149]) by olra.theworths.org (Postfix) with ESMTP id 5C975431FAE for ; Mon, 6 Oct 2014 06:25:20 -0700 (PDT) Received: from [104.131.20.129] (helo=awakeningjr) by outgoing.csail.mit.edu with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Xb8Ht-0004OY-8x; Mon, 06 Oct 2014 09:25:17 -0400 Received: from amthrax by awakeningjr with local (Exim 4.84) (envelope-from ) id 1Xb8Hs-0000P3-FC; Mon, 06 Oct 2014 09:25:16 -0400 Date: Mon, 6 Oct 2014 09:25:16 -0400 From: Austin Clements To: David Bremner Subject: Re: [PATCH 02/11] lib: Refactor _notmuch_database_link_message Message-ID: <20141006132516.GF7970@csail.mit.edu> References: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> <1412345958-8278-3-git-send-email-aclements@csail.mit.edu> <87k34fot7d.fsf@maritornes.cs.unb.ca> <20141005232008.GB7970@csail.mit.edu> <871tqlpwcx.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871tqlpwcx.fsf@maritornes.cs.unb.ca> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: notmuch@notmuchmail.org 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, 06 Oct 2014 13:25:26 -0000 Quoth David Bremner on Oct 06 at 8:04 am: > Austin Clements writes: > > > Quoth David Bremner on Oct 05 at 9:45 am: > >> Austin Clements writes: > >> > + void *local = talloc_new (NULL); > >> > >> What's the advantage of using a local talloc context here? Is this just > >> an optimization? > > > > There are a few allocations that wind up going in to this local > > context because of the call to _consume_metadata_thread_id, so it's > > more convenient to free this one context on return from > > _notmuch_database_link_message than to worry about tracking these > > various allocations. > > OK, but wouldn't the lazy solution be to use message as a talloc > context? That would be the lazy solution, but it would also leak a bunch of allocations that don't need to live past the end of _notmuch_database_link_message.