+typedef struct {
+ void *nm_object;
+} notmuch_rb_object_t;
+
+static inline void *
+notmuch_rb_object_create (void *nm_object, const char *name)
+{
+ notmuch_rb_object_t *rb_wrapper = talloc_named_const (NULL, sizeof (*rb_wrapper), name);
+
+ if (RB_UNLIKELY (!rb_wrapper))
+ return NULL;
+
+ rb_wrapper->nm_object = nm_object;
+ talloc_steal (rb_wrapper, nm_object);
+ return rb_wrapper;
+}
+
+static inline void
+notmuch_rb_object_free (void *rb_wrapper)
+{
+ talloc_free (rb_wrapper);
+}
+
+static inline void