mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-25 16:46:52 +02:00
Minor doc clarification
Mention g_realloc() as a possible function to use with g_memory_output_stream_new(). Bug 612041.
This commit is contained in:
parent
42f042d5fb
commit
0a51b58e07
@ -332,8 +332,8 @@ g_memory_output_stream_init (GMemoryOutputStream *stream)
|
|||||||
* g_memory_output_stream_new:
|
* g_memory_output_stream_new:
|
||||||
* @data: pointer to a chunk of memory to use, or %NULL
|
* @data: pointer to a chunk of memory to use, or %NULL
|
||||||
* @size: the size of @data
|
* @size: the size of @data
|
||||||
* @realloc_function: a function with realloc() semantics to be called when
|
* @realloc_function: a function with realloc() semantics (like g_realloc())
|
||||||
* @data needs to be grown, or %NULL
|
* to be called when @data needs to be grown, or %NULL
|
||||||
* @destroy_function: a function to be called on @data when the stream is
|
* @destroy_function: a function to be called on @data when the stream is
|
||||||
* finalized, or %NULL
|
* finalized, or %NULL
|
||||||
*
|
*
|
||||||
@ -343,13 +343,17 @@ g_memory_output_stream_init (GMemoryOutputStream *stream)
|
|||||||
* If @realloc_fn is non-%NULL, it will be used for resizing the internal
|
* If @realloc_fn is non-%NULL, it will be used for resizing the internal
|
||||||
* storage when necessary. To construct a fixed-size output stream,
|
* storage when necessary. To construct a fixed-size output stream,
|
||||||
* pass %NULL as @realloc_fn.
|
* pass %NULL as @realloc_fn.
|
||||||
|
*
|
||||||
* |[
|
* |[
|
||||||
* /* a stream that can grow */
|
* /* a stream that can grow */
|
||||||
* stream = g_memory_output_stream_new (NULL, 0, realloc, free);
|
* stream = g_memory_output_stream_new (NULL, 0, realloc, free);
|
||||||
*
|
*
|
||||||
|
* /* another stream that can grow */
|
||||||
|
* stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
|
||||||
|
*
|
||||||
* /* a fixed-size stream */
|
* /* a fixed-size stream */
|
||||||
* data = malloc (200);
|
* data = malloc (200);
|
||||||
* stream2 = g_memory_output_stream_new (data, 200, NULL, free);
|
* stream3 = g_memory_output_stream_new (data, 200, NULL, free);
|
||||||
* ]|
|
* ]|
|
||||||
*
|
*
|
||||||
* Return value: A newly created #GMemoryOutputStream object.
|
* Return value: A newly created #GMemoryOutputStream object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user