Re: [PATCH v2 10/10] ruby: new notmuch_rb_object_destroy() helper

Subject: Re: [PATCH v2 10/10] ruby: new notmuch_rb_object_destroy() helper

Date: Wed, 12 May 2021 19:10:03 -0300

To: Felipe Contreras, notmuch@notmuchmail.org

Cc:

From: David Bremner


Felipe Contreras <felipe.contreras@gmail.com> 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

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: