On 21 March 2016 at 04:50, Alexandre Julliard julliard@winehq.org wrote:
While we probably don't want that in all cases, having the option of a simpler, allocation-free rbtree would be nice. I suspect there are a number of global lists that could benefit from that.
I don't know. I think that outside of D3D it's only used in dbghelp and winemenubuilder, and at least in the winemenubuilder case it might be better to just sort the prog ID list before using it to generate associations. As for the usage in D3D, I think there could potentially be value in having a stack per-thread instead of per-rbtree, but I don't think that would necessarily make things simpler. Having a fixed stack size could certainly be done, but I don't think simply increasing the size of struct wine_rb_tree would make things better for any of the existing cases.
If I were to make an API change, I'd probably split the compare function out of struct wine_rb_functions, replace the allocation functions with functions to manage the rbtree stack, and then provide a default HeapAlloc() or RtlAllocateHeap() based implementation for those.