Skip to content

garray: Add more G(Ptr)Array constructors to take or copy C arrays

Marco Trevisan requested to merge 3v1n0/glib:ptr-array-new-take into main

GPtrArray and GArray are a nice interface to handle (pointer) arrays (and way more efficient than GList). However if we need to handle a C-array or a strv so that can be modified easily we need to perform copies or re-add all the values manually, so adding some utility functions to create array stealing or copying from data.

I've been doing this as I was starting moving away from usage of G(S)List in some internal places, and this may help to avoid duplication.

Merge request reports