After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 506374 - gmemoryinputstream api
gmemoryinputstream api
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-12-30 06:35 UTC by Matthias Clasen
Modified: 2008-01-04 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch (8.89 KB, patch)
2008-01-04 05:35 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2007-12-30 06:35:07 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)
Comment 1 Alexander Larsson 2008-01-03 09:19:48 UTC
Seems good to me. However, we probably want a new_from_data() helper for the case of a single piece of data.
Comment 2 Matthias Clasen 2008-01-04 05:35:17 UTC
Created attachment 102087 [details] [review]
a patch

Here is a lightly tested patch that adds the outlined api.
Comment 3 Alexander Larsson 2008-01-04 10:11:59 UTC
Looks good to me. I'll apply and fix up all users.