blob: 038f63e7989232310e53831d6613801c6d676675 [file] [log] [blame]
<!-- ##### SECTION Title ##### -->
Memory Allocators
<!-- ##### SECTION Short_Description ##### -->
deprecated way to allocate chunks of memory for #GList, #GSList and #GNode.
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<para>
Prior to 2.10, #GAllocator was used as an efficient way to allocate
small pieces of memory for use with the #GList, #GSList and #GNode data
structures. Since 2.10, it has been completely replaced by the
<link linkend="glib-Memory-Slices">slice allocator</link> and deprecated.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GAllocator ##### -->
<para>
The <structname>GAllocator</structname> struct contains private data. and
should only be accessed using the following functions.
</para>
<!-- ##### FUNCTION g_allocator_new ##### -->
<para>
Creates a new #GAllocator.
</para>
@name: the name of the #GAllocator. This name is used to set the name of the
#GMemChunk used by the #GAllocator, and is only used for debugging.
@n_preallocs: the number of elements in each block of memory allocated.
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
and 65535.
@Returns: a new #GAllocator.
@Deprecated: 2.10: Use the <link linkend="glib-Memory-Slices">slice allocator</link>
instead
<!-- ##### FUNCTION g_allocator_free ##### -->
<para>
Frees all of the memory allocated by the #GAllocator.
</para>
@allocator: a #GAllocator.
@Deprecated: 2.10: Use the <link linkend="glib-Memory-Slices">slice allocator</link>
instead