31 May
2023
31 May
'23
8:42 p.m.
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2944#note_34250