From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id r765Db0kw2ChXQAAgWs5BA (envelope-from ) for ; Fri, 11 Jun 2021 10:54:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yAk/CL0kw2BxTgAAB5/wlQ (envelope-from ) for ; Fri, 11 Jun 2021 08:54:21 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A02B310BC3 for ; Fri, 11 Jun 2021 10:54:20 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DC8F12B20F; Fri, 11 Jun 2021 04:54:10 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 44D122B1E9 for ; Fri, 11 Jun 2021 04:54:08 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id EADCC5FD25; Fri, 11 Jun 2021 04:54:06 -0400 (EDT) Received: (nullmailer pid 486055 invoked by uid 1000); Fri, 11 Jun 2021 08:54:05 -0000 From: David Bremner To: Felipe Contreras , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] ruby: enable garbage collection using talloc In-Reply-To: <874ke5tehj.fsf@tethera.net> References: <20210517193915.1220114-1-felipe.contreras@gmail.com> <20210517193915.1220114-3-felipe.contreras@gmail.com> <874ke5tehj.fsf@tethera.net> Date: Fri, 11 Jun 2021 05:54:05 -0300 Message-ID: <871r98u6he.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: COA4UQ4R7VORC7CMQIWAE2OBKSISM27F X-Message-ID-Hash: COA4UQ4R7VORC7CMQIWAE2OBKSISM27F X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Tomi Ollila X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623401661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ef3Aj26ShTaQqXZupT4f2OLlrQ1LzCp93ZWzouZLOFA=; b=Tz7uBpCProN+R0sgljTyu45eJQLM9SxTACCFBwBUeCfkBqSN5tujep+piwP/idzXdovtKt qat9K9MfPhQrDRfaufx2QQqX+eRjr80iiVKRQ5h4kf5MLpKdyr8aaDKCLDwr4e33IvdqPY igNNpGQZqNtfiYy4bEW6D0RxNpvAheSP6JnYdkAfsM9IVz0Fcs1iqMZe1SEwLAxt9URnv1 Ml/NcJ6h22n7Mr79U0T1++PBULstnR4rWDvmalNRhst4luJqtnuycjTZ3ES3XgS+Hjwsx9 /+Vfcqlv8AUzPTvBfNsDkCb6067lr+zA4Gsjn1hZiJ8MHhkaXKaGqIgSKrsgew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623401661; a=rsa-sha256; cv=none; b=R7yM6oye+SyafnTD9Q+co7a7mnn5x8hq8LAvAWmI/2um7vdfCoXRqjNhD0GgHy1ZFSwyUd 9HV/wQu7QlsD9mr5Jfhg4ulLk6cRNNLmQuxBueXP3Lsv2lFygl3J6Zm8cEiUw8OFYaw1dB SwkFrv07LBmwi2ZihyEcUTGrUf3z4MebYp4VqW3eazr6fQ1vde53lqXyYVy+SniPg7Z+zd SSXGuxjSfTuMeuShoNc73mRTDnGrYmw43VnPVPGYtP7pt1K1WuS5YMC4j7GQzLHcyDW1JZ rkPoJ2cTCP4Ff5pCSQlpsrAZ+HUxFf+NWie1+uC8avnE31OPMxuVEDdQigiIBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: A02B310BC3 X-Spam-Score: -2.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: WoPvqIY6UOlN David Bremner writes: > Felipe Contreras writes: > >> We basically steal all the objects from their notmuch parents, therefore >> they are completely under Ruby's gc control. >> >> The order at which these objects are freed does not matter any more, >> because destroying the database does not destroy all the children >> objects, since they belong to Ruby now. >> > > I guess from a purist point of view this is a kind of layering > violation, since the use of talloc is purportedly an internal > implementation detail of the library. Still, I think it's a reasonable > approach given that the ruby bindings are maintained as part of notmuch, > and we are not very likely to abandon talloc. > One issue to double check: in a few places we explicitely _don't_ use talloc. What happens when those objects are passed to talloc_steal? d