Michael Catanzaro from #GNOME published yesterday this interesting blog post about binding C libraries and a nice feature of #Vala; at the end there is the convenient solution (you can skip to it if you want ;)
https://blogs.gnome.org/mcatanzaro/2024/07/10/forcibly-set-array-size-in-vala/
#ValaLang #GNOME #GTK #GTK4
Forcibly Set Array Size in Vala – Michael Catanzaro's Blog

@vala_lang You can resize Vala arrays by just changing the length property?!
@charadon Yes, it is possible, at least for resizable arrays. A quick search through our test suite gives this result:
https://gitlab.gnome.org/GNOME/vala/-/blob/main/tests/basic-types/arrays.vala#L145
tests/basic-types/arrays.vala · main · GNOME / vala · GitLab

📘 Manual | 📗 libvala API docs

GitLab