mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-22 07:09:16 +02:00
Updates
2005-12-05 Matthias Clasen <mclasen@redhat.com> * gobject/tmpl/generic_values.sgml: * glib/tmpl/trees-nary.sgml: * glib/tmpl/linked_lists_double.sgml: * glib/tmpl/linked_lists_single.sgml: * glib/tmpl/memory_chunks.sgml: * glib/tmpl/allocators.sgml: * glib/tmpl/macros_misc.sgml: Updates * glib/Makefile.am: Ignore gmirroringtable.h
This commit is contained in:
parent
9e5ac8717f
commit
a59e49a545
@ -1,5 +1,13 @@
|
|||||||
2005-12-05 Matthias Clasen <mclasen@redhat.com>
|
2005-12-05 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gobject/tmpl/generic_values.sgml:
|
||||||
|
* glib/tmpl/trees-nary.sgml:
|
||||||
|
* glib/tmpl/linked_lists_double.sgml:
|
||||||
|
* glib/tmpl/linked_lists_single.sgml:
|
||||||
|
* glib/tmpl/memory_chunks.sgml:
|
||||||
|
* glib/tmpl/allocators.sgml:
|
||||||
|
* glib/tmpl/macros_misc.sgml: Updates
|
||||||
|
|
||||||
* glib/Makefile.am: Ignore gmirroringtable.h
|
* glib/Makefile.am: Ignore gmirroringtable.h
|
||||||
|
|
||||||
2005-12-04 Matthias Clasen <mclasen@redhat.com>
|
2005-12-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
@ -2,31 +2,16 @@
|
|||||||
Memory Allocators
|
Memory Allocators
|
||||||
|
|
||||||
<!-- ##### SECTION Short_Description ##### -->
|
<!-- ##### SECTION Short_Description ##### -->
|
||||||
allocates chunks of memory for #GList, #GSList and #GNode.
|
deprecated way to allocate chunks of memory for #GList, #GSList and #GNode.
|
||||||
|
|
||||||
<!-- ##### SECTION Long_Description ##### -->
|
<!-- ##### SECTION Long_Description ##### -->
|
||||||
<para>
|
<para>
|
||||||
The #GAllocator is used as an efficient way to allocate small pieces of
|
|
||||||
memory for use with the #GList, #GSList and #GNode data structures.
|
|
||||||
It uses a #GMemChunk so elements are allocated in groups, rather than
|
|
||||||
individually.
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The #GList, #GSList and #GNode implementations create default #GAllocator
|
Prior to 2.10, #GAllocator was used as an efficient way to allocate
|
||||||
objects, which are probably sufficient for most purposes. These default
|
small pieces of memory for use with the #GList, #GSList and #GNode data
|
||||||
allocators use blocks of 128 elements.
|
structures. Since 2.10, it has been completely replaced by the
|
||||||
</para>
|
<link linkend="glib-Memory-Slices">slice allocator</link> and deprecated.
|
||||||
<para>
|
|
||||||
To use your own #GAllocator, create it with g_allocator_new(). Then
|
|
||||||
use g_list_push_allocator(), g_slist_push_allocator() or
|
|
||||||
g_node_push_allocator() before any code which allocates new #GList, #GSList
|
|
||||||
or #GNode elements respectively. After allocating the new elements, you must
|
|
||||||
use g_list_pop_allocator(), g_slist_pop_allocator() or g_node_pop_allocator()
|
|
||||||
to restore the previous allocators.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Note that you cannot use the same allocator for #GList, #GSList and #GNode
|
|
||||||
elements. Each must use separate allocators.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<!-- ##### SECTION See_Also ##### -->
|
<!-- ##### SECTION See_Also ##### -->
|
||||||
@ -39,8 +24,8 @@ elements. Each must use separate allocators.
|
|||||||
|
|
||||||
<!-- ##### STRUCT GAllocator ##### -->
|
<!-- ##### STRUCT GAllocator ##### -->
|
||||||
<para>
|
<para>
|
||||||
The <structname>GAllocator</structname> struct contains private data. and should only be accessed
|
The <structname>GAllocator</structname> struct contains private data. and
|
||||||
using the following functions.
|
should only be accessed using the following functions.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|
||||||
@ -56,6 +41,8 @@ Larger blocks mean less calls to g_malloc(), but some memory may be wasted.
|
|||||||
(GLib uses 128 elements per block by default.) The value must be between 1
|
(GLib uses 128 elements per block by default.) The value must be between 1
|
||||||
and 65535.
|
and 65535.
|
||||||
@Returns: a new #GAllocator.
|
@Returns: a new #GAllocator.
|
||||||
|
@Deprecated: Use the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
instead
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_allocator_free ##### -->
|
<!-- ##### FUNCTION g_allocator_free ##### -->
|
||||||
@ -64,5 +51,7 @@ Frees all of the memory allocated by the #GAllocator.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
@allocator: a #GAllocator.
|
@allocator: a #GAllocator.
|
||||||
|
@Deprecated: Use the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
instead
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,8 +25,9 @@ of the
|
|||||||
or simply pointers to any type of data.
|
or simply pointers to any type of data.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
List elements are allocated in blocks using a #GAllocator, which is
|
List elements are allocated from the <link linkend="glib-Memory-Slices">slice
|
||||||
more efficient than allocating elements individually.
|
allocator</link>, which is more efficient than allocating elements
|
||||||
|
individually.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Note that most of the #GList functions expect to be passed a pointer to
|
Note that most of the #GList functions expect to be passed a pointer to
|
||||||
@ -224,7 +225,7 @@ the first node matching the given data.
|
|||||||
<!-- ##### FUNCTION g_list_free ##### -->
|
<!-- ##### FUNCTION g_list_free ##### -->
|
||||||
<para>
|
<para>
|
||||||
Frees all of the memory used by a #GList.
|
Frees all of the memory used by a #GList.
|
||||||
The freed elements are added to the #GAllocator free list.
|
The freed elements are returned to the slice allocator.
|
||||||
</para>
|
</para>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
@ -501,6 +502,8 @@ with <option>--disable-mem-pools</option>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
@allocator: the #GAllocator to use when allocating #GList elements.
|
@allocator: the #GAllocator to use when allocating #GList elements.
|
||||||
|
@Deprecated: Since 2.10, it does nothing, since #GList has been
|
||||||
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_list_pop_allocator ##### -->
|
<!-- ##### FUNCTION g_list_pop_allocator ##### -->
|
||||||
@ -512,5 +515,8 @@ Note that this function is not available if GLib has been compiled
|
|||||||
with <option>--disable-mem-pools</option>
|
with <option>--disable-mem-pools</option>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@Deprecated: Since 2.10, it does nothing, since #GList has been
|
||||||
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,8 +25,9 @@ of the
|
|||||||
or simply pointers to any type of data.
|
or simply pointers to any type of data.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
List elements are allocated in blocks using a #GAllocator, which is
|
List elements are allocated from the <link linkend="glib-Memory-Slices">slice
|
||||||
more efficient than allocating elements individually.
|
allocator</link>, which is more efficient than allocating elements
|
||||||
|
individually.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Note that most of the #GSList functions expect to be passed a pointer to
|
Note that most of the #GSList functions expect to be passed a pointer to
|
||||||
@ -232,7 +233,7 @@ the first node matching the given data.
|
|||||||
<!-- ##### FUNCTION g_slist_free ##### -->
|
<!-- ##### FUNCTION g_slist_free ##### -->
|
||||||
<para>
|
<para>
|
||||||
Frees all of the memory used by a #GSList.
|
Frees all of the memory used by a #GSList.
|
||||||
The freed elements are added to the #GAllocator free list.
|
The freed elements are returned to the slice allocator.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@list: a #GSList.
|
@list: a #GSList.
|
||||||
@ -247,13 +248,14 @@ It is usually used after g_slist_remove_link().
|
|||||||
@list: a #GSList element.
|
@list: a #GSList element.
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_slist_free1 ##### -->
|
<!-- ##### MACRO g_slist_free1 ##### -->
|
||||||
<para>
|
<para>
|
||||||
A macro which does the same as g_slist_free_1().
|
A macro which does the same as g_slist_free_1().
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@Since: 2.10
|
@Since: 2.10
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_slist_length ##### -->
|
<!-- ##### FUNCTION g_slist_length ##### -->
|
||||||
<para>
|
<para>
|
||||||
Gets the number of elements in a #GSList.
|
Gets the number of elements in a #GSList.
|
||||||
@ -431,9 +433,9 @@ Note that this function is not available if GLib has been compiled
|
|||||||
with <option>--disable-mem-pools</option>
|
with <option>--disable-mem-pools</option>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@dummy:
|
@dummy: the #GAllocator to use when allocating #GSList elements.
|
||||||
<!-- # Unused Parameters # -->
|
@Deprecated: Since 2.10, it does nothing, since #GSList has been
|
||||||
@allocator: the #GAllocator to use when allocating #GSList elements.
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_slist_pop_allocator ##### -->
|
<!-- ##### FUNCTION g_slist_pop_allocator ##### -->
|
||||||
@ -445,5 +447,8 @@ Note that this function is not available if GLib has been compiled
|
|||||||
with <option>--disable-mem-pools</option>
|
with <option>--disable-mem-pools</option>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@Deprecated: Since 2.10, it does nothing, since #GSList has been
|
||||||
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,6 +250,7 @@ See the GNU C documentation for details.
|
|||||||
Since: 2.8
|
Since: 2.8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO G_GNUC_WARN_UNUSED_RESULT ##### -->
|
<!-- ##### MACRO G_GNUC_WARN_UNUSED_RESULT ##### -->
|
||||||
<para>
|
<para>
|
||||||
Expands to the GNU C <literal>warn_unused_ersult</literal> function attribute
|
Expands to the GNU C <literal>warn_unused_ersult</literal> function attribute
|
||||||
@ -258,7 +259,8 @@ attribute makes the compiler emit a warning if the result of a function call
|
|||||||
is ignored. See the GNU C documentation for details.
|
is ignored. See the GNU C documentation for details.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
Since: 2.10
|
@Since: 2.10
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO G_GNUC_FUNCTION ##### -->
|
<!-- ##### MACRO G_GNUC_FUNCTION ##### -->
|
||||||
|
@ -527,9 +527,9 @@ Note that this function is not available if GLib has been compiled
|
|||||||
with <option>--disable-mem-pools</option>
|
with <option>--disable-mem-pools</option>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@dummy:
|
@dummy: the #GAllocator to use when allocating #GNode elements.
|
||||||
<!-- # Unused Parameters # -->
|
@Deprecated: Since 2.10, it does nothing, since #GNode has been
|
||||||
@allocator: the #GAllocator to use when allocating #GNode elements.
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_node_pop_allocator ##### -->
|
<!-- ##### FUNCTION g_node_pop_allocator ##### -->
|
||||||
@ -541,5 +541,7 @@ Note that this function is not available if GLib has been compiled
|
|||||||
with <option>--disable-mem-pools</option>
|
with <option>--disable-mem-pools</option>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@Deprecated: Since 2.10, it does nothing, since #GNode has been
|
||||||
|
converted to the <link linkend="glib-Memory-Slices">slice allocator</link>
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ value_table's collect_value() function.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
@value: An initialized #GValue structure.
|
@value: An initialized #GValue structure.
|
||||||
@instance:
|
@instance: the instance
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_value_fits_pointer ##### -->
|
<!-- ##### FUNCTION g_value_fits_pointer ##### -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user