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
This commit is contained in:
Colin Walters
2012-11-22 08:23:27 -05:00
parent 7a5dd54f47
commit ed5c17e11f
5 changed files with 20 additions and 2 deletions

View File

@@ -863,6 +863,7 @@ GBufferedOutputStreamPrivate
GReallocFunc
GMemoryOutputStream
g_memory_output_stream_new
g_memory_output_stream_new_resizable
g_memory_output_stream_get_data
g_memory_output_stream_get_size
g_memory_output_stream_get_data_size