Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/window.c:
WINE_DEFAULT_DEBUG_CHANNEL(waylanddrv);
+/* private window data */ +struct wayland_win_data +{
- /* hwnd that this private data belongs to */
- HWND hwnd;
+};
+static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER; +static struct wayland_win_data *win_data_context[32768];
+static inline int context_idx(HWND hwnd) +{
- return LOWORD(hwnd) >> 1;
+}
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.