From: Ethan Glasser-Camp Date: Fri, 19 Oct 2012 03:55:40 +0000 (+2000) Subject: Re: [PATCH 3/7] go: Allow notmuch objects to be garbage collected X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=95fe55105ab4f5257fce28f4613a7f435e0dd2e4;p=notmuch-archives.git Re: [PATCH 3/7] go: Allow notmuch objects to be garbage collected --- diff --git a/ae/ba82d5f30f4de5a5a5a013b802ab0aa1b9d6ea b/ae/ba82d5f30f4de5a5a5a013b802ab0aa1b9d6ea new file mode 100644 index 000000000..91d4827c5 --- /dev/null +++ b/ae/ba82d5f30f4de5a5a5a013b802ab0aa1b9d6ea @@ -0,0 +1,85 @@ +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 0F333431FB6 + for ; Thu, 18 Oct 2012 20:55:47 -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=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 e6NTR5+YeGWs for ; + Thu, 18 Oct 2012 20:55:46 -0700 (PDT) +Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com + [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6A261431FAE + for ; Thu, 18 Oct 2012 20:55:46 -0700 (PDT) +Received: by mail-vb0-f53.google.com with SMTP id fc21so40924vbb.26 + for ; Thu, 18 Oct 2012 20:55:45 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=h40uiBQEZojm1y1Y1lvmt3SBNoHLkbx/6MzR95f2XuY=; + b=JFpWp5Yyro52w4bx4K1HAwdFv46i8tC2991tr7wMbFk89+6RS9estq+8blXvX/61hd + rggCDLDZIpqQhQxkgDDSF/u83q7MjrwwWDXlp76igYxSL3+OQ0PvM7pS+QdTijsj6eFy + n50zqD5bcc8aeLCpZz/pIUYIwHZ2Lk8t8NdC9vMfARGJEq3nZfNTsLj68yy6FWhhItEu + pfAkC1zSUX8Ngqp37fLCsy0tmfThtUYLHbT7/tVDMqIvE3uQsVg+ZlpF0chHRxNCDwFG + s8MdAa/P43xjGgW80VjE0gIdGLMF8pExdK014nHvpLOAXJNw0lmqgfsdI2QdDIAwkkl5 + ADrA== +Received: by 10.52.23.225 with SMTP id p1mr14645207vdf.79.1350618945742; + Thu, 18 Oct 2012 20:55:45 -0700 (PDT) +Received: from smtp.gmail.com (p70-80.acedsl.com. [66.114.70.80]) + by mx.google.com with ESMTPS id zx18sm615107veb.3.2012.10.18.20.55.43 + (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 18 Oct 2012 20:55:43 -0700 (PDT) +From: Ethan Glasser-Camp +To: Adrien Bustany , notmuch@notmuchmail.org +Subject: Re: [PATCH 3/7] go: Allow notmuch objects to be garbage collected +In-Reply-To: <1342636475-16057-4-git-send-email-adrien@bustany.org> +References: <1342636475-16057-1-git-send-email-adrien@bustany.org> + <1342636475-16057-4-git-send-email-adrien@bustany.org> +User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-pc-linux-gnu) +Date: Thu, 18 Oct 2012 23:55:40 -0400 +Message-ID: <87wqyn6rpf.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +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: Fri, 19 Oct 2012 03:55:47 -0000 + +Adrien Bustany writes: + +> This makes notmuch appropriately free the underlying notmuch C objects +> when garbage collecting their Go wrappers. To make sure we don't break +> the underlying links between objects (for example, a notmuch_messages_t +> being GC'ed before a notmuch_message_t belonging to it), we add for each +> wraper struct a pointer to the owner object (Go objects with a reference +> pointing to them don't get garbage collected). + +Hi Adrien! This whole series is marked moreinfo, but I don't think +that's just. It looks like there were some unresolved issues about +reference tracking and garbage collection, and some suggestions to use +the C values of enums instead of regenerating them with iota, but +there's definitely valid code that I assume would be useful if anyone +ever wanted to write in Go ;). Are you figuring to clean this series up? + +This comment should s/wraper/wrapper/. + +Ethan