On Wed May 31 20:42:18 2023 +0000, Rémi Bernon wrote:
I like the simplicity but I'm tempted to say that this is wasting memory. I also don't like very much that this relies on some implicit property of HWND values. Maybe it is alright, but I don't know how stable or correct they are.
This is another case of me copying what another driver is doing (wineandroid), expecting it to be a reasonable approach (and I think it basically is) :) If there are any concerns about this code, I am happy to replace it with a simple map implementation. Since I don't want to implement a custom hashtable just for this, I am tempted to use `rb_tree`. Although `rb_tree` won't be ideal for a small number of windows (high constant factors), it's readily available and has a good asymptotic behavior, so we won't choke if any app decides to create thousands of windows. As a side note, I am curious if there have ever been any thoughts or discussions about introducing a hashtable implementation in include/wine, since that would been a good match for this use case.