Rethinking *_destroy()

Ben Gamari bgamari.foss at gmail.com
Mon Sep 19 15:08:22 PDT 2011


On Mon, 19 Sep 2011 16:22:39 -0400, Ben Gamari <bgamari.foss at gmail.com> wrote:
> I can see at least two ways of doing this,
> 
>   1) Acknowledging that we use talloc and allowing users to use
>      talloc_ref and talloc_unlink directly
> 
>   2) Wrapping talloc by adding a *_ref() and *_unref() to each object
> 
I should not that these aren't quite as trivial as they sound. As I
neglect to mention in this message, we currently use talloc_free in
*_destroy(). As of talloc-2.0, talloc_free() fails on objects with more
than one parent. When we allow library users to add their own references
to notmuch objects, this assumption will break. Sorry for the confusion,

Cheers,

- Ben


More information about the notmuch mailing list