From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UKsnD0RSnGCk+wAAgWs5BA (envelope-from ) for ; Thu, 13 May 2021 00:10:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sGa2CkRSnGDdVAAAbx9fmQ (envelope-from ) for ; Wed, 12 May 2021 22:10:12 +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 BE79F1935D for ; Thu, 13 May 2021 00:10:11 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DF00E2717B; Wed, 12 May 2021 18:10:07 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 67CCB2717A for ; Wed, 12 May 2021 18:10:05 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3C73960018; Wed, 12 May 2021 18:10:05 -0400 (EDT) Received: (nullmailer pid 1253513 invoked by uid 1000); Wed, 12 May 2021 22:10:03 -0000 From: David Bremner To: Felipe Contreras , notmuch@notmuchmail.org Subject: Re: [PATCH v2 10/10] ruby: new notmuch_rb_object_destroy() helper In-Reply-To: <20210504081749.715768-11-felipe.contreras@gmail.com> References: <20210504081749.715768-1-felipe.contreras@gmail.com> <20210504081749.715768-11-felipe.contreras@gmail.com> Date: Wed, 12 May 2021 19:10:03 -0300 Message-ID: <875yznfvt0.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: VDZQJQCF7GSVS5KUVVDMPVGKNXBLYSN7 X-Message-ID-Hash: VDZQJQCF7GSVS5KUVVDMPVGKNXBLYSN7 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 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=1620857411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=Dl/B7WSsonrys0QQn03hHc1Jw4FU9mXJRw5tdy/Pr30=; b=nmNIHiEXoK0WMke141TRfOr5pbG291jufU6ADI0+pCge3eHNzoXuJRXNu/+zJHeXNmGOA+ OlmbzQqYOvL//FskqshmCM9LVM3yfcSOYlYgwpdzZrya+lfv3hyo7jQpCHCv/CTmgdkKkh mZX0eN4Kn+QegWSH2zQgtMYdemStW4g6wO7DGLiJno2kVig0kS+2KZ3YQikvpaR56Bt2TC uSLVzY2IjTjYbl9ssH4/2fuO4vkGn8RY+B2JnwJ8A5ylxwzDv9BX9Mmm/HxMNqJMhyrreG D6b/YadzxJrjYv1fOebrzVWQTzxflVOuOqOJDGu4xDkLPdLsTMuLLmQVZGhUKA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620857411; a=rsa-sha256; cv=none; b=tNwFoTJHKCvXBG6Dgej2XdWVwKl9QuNQMtDyoxCIZVXeJM0YtRB5d4UjEKqayc4w574Fln 5fAM7yEEDEqSylGUaZ9M/kl7obsopz3E88K3tvl1TyN8zvA6VRgnJFl/YlLw2TOo5gBTer rARIiwEu0S6isu/o7E2cfNU5Tzsi7+eGt6tjs31ysExPv9GJnLKd9QW1sUbFQHhoxuMx6U QtSuWL8zGmNj5vCzsKqFofduDs7XnG05Os4ozbtWubu4k76bxz46r4emDQt2aqmAMPEco0 om2S5oF+gYMHD7g5Y+IlSaDpcNxFaYgTQjPWdnUffGWMvZg4uzWshK+Tx/uEJA== 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: BE79F1935D X-Spam-Score: -2.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: B+wW7RexIRAM Felipe Contreras writes: > +static inline notmuch_status_t > +notmuch_rb_object_destroy (VALUE rb_object, const rb_data_type_t *type) > +{ > + void *nm_object; > + notmuch_status_t ret; > + > + Data_Get_Notmuch_Object (rb_object, type, nm_object); > + > + ret = ((notmuch_status_t (*)(void *)) type->data) (nm_object); > + DATA_PTR (rb_object) = NULL; > + > + return ret; > +} > + I see the benefit of making the code shorter, but I don't understand the new code, while I did (mostly) understand the old code. So please explain this in a comment as if I have no idea how ruby extensions work. d