GNOME Bugzilla – Bug 506374
gmemoryinputstream api
Last modified: 2008-01-04 10:11:59 UTC
Looking at the gmemoryinputstream api, I wonder if the following would not make more sense: GInputStream *g_memory_input_stream_new (void) void g_memory_input_stream_add_data (const void *data, gssize len, GDestroyNotify *destroy); This would a) allow the input stream to be based on more than one chunk of memory and b) allow to use memory that must be freed by other means than g_free (e.g. munmap or g_slice_free)
Seems good to me. However, we probably want a new_from_data() helper for the case of a single piece of data.
Created attachment 102087 [details] [review] a patch Here is a lightly tested patch that adds the outlined api.
Looks good to me. I'll apply and fix up all users.