[PATCH 13/14] rbtree.h: Added WINE_RB_FOR_EACH_DESTRUCTOR and WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR helpers for implementing tree destructors.

Jacek Caban jacek at codeweavers.com
Wed Feb 15 09:11:42 CST 2017


On 14.02.2017 20:03, Matteo Bruni wrote:
> I guess my remaining question is whether it makes sense to just
> introduce the _SAFE variant right away, in place of this one. If I'm
> not mistaken that would be a bit slower since you'd need to
> wine_rb_remove() the elements one by one before freeing them but it
> might be more "natural" in a way, since it would match the semantics
> of the list. I'm not opposed to this patch in any case.

I would prefer sticking with _DESTRUCTOR variant. It's both faster (O(n)
vs O(n log n)) and makes implementing destructor slightly easier. It's
not very strong opinion through.

Thanks,
Jacek



More information about the wine-devel mailing list