On Thu Feb 29 19:21:04 2024 +0000, Rémi Bernon wrote:
Instead of an allocating array that could fail, you could just add another linked list entry, say `release_entry` or `tmp_entry`, to the struct wayland_gl_drawable and use it to link them in a release list. You can then also do the same to link drawables in a local release list in wgl_context_make_current.
The problem with the (invasive) linked list approach is that it doesn't allow us to mark the same drawable for release multiple times (the simplest case when this is needed is when `ctx->draw == ctx->read == old`). We could combine the release list with an extra field in `struct wayland_gl_drawable` to hold the release count, though.
If the main concern is the allocations, perhaps we can get away with using a large enough stack array based solution?