gstrvbuilder: Add g_strv_builder_take

g_strv_builder_take() allows to transfer ownership of the passed in
string.

This can be useful to avoid additional allocations when using functions
that transfer ownership to the caller like g_strdup_printf().

The testcase uses g_strv_builder_take and g_strv_builder_add to demo
that calls can be mixed.
This commit is contained in:
Guido Günther
2023-10-15 15:30:52 +02:00
parent 046f70cc0d
commit bc4ba05d34
4 changed files with 43 additions and 0 deletions

View File

@@ -1604,6 +1604,7 @@ g_strv_builder_unref
g_strv_builder_add
g_strv_builder_addv
g_strv_builder_add_many
g_strv_builder_take
g_strv_builder_end
<SUBSECTION>