GMemoryOutputStream: Add new _resizable() constructor usable from bindings
authorColin Walters <walters@verbum.org>
Thu, 22 Nov 2012 13:23:27 +0000 (08:23 -0500)
committerColin Walters <walters@verbum.org>
Wed, 28 Nov 2012 01:45:21 +0000 (20:45 -0500)
commited5c17e11f3b37b0725e1ca2f62511338fa23f1b
tree4938fe1a00a6946ab0d50ab9ba9dafdec89ad465
parent7a5dd54f472790c7ba366d267c637eb203797c14
GMemoryOutputStream: Add new _resizable() constructor usable from bindings

Really, the memory output stream API is too warped around the model
where it's a fixed size buffer that you've already allocated.  Even in
C, I find myself always wanting to use it to just accumulate data into
an arbitrary-sized buffer it allocates.

Unfortunately, it's also not usable from bindings because it's not
common to bind g_free() and g_realloc(), but if you just pass NULL, you
get the default of a fixed size, which is useless as per above.

I am going to use this from a gjs test case, and the GSubprocess test
cases also will use it.

https://bugzilla.gnome.org/show_bug.cgi?id=688931
docs/reference/gio/gio-sections.txt
gio/gio.symbols
gio/gmemoryoutputstream.c
gio/gmemoryoutputstream.h
gio/tests/memory-output-stream.c