~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Memory-Allocators.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Memory Allocators</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GLib Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
9
9
<link rel="prev" href="glib-Caches.html" title="Caches">
10
10
<link rel="next" href="tools.html" title="GLib Tools">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
26
26
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
27
27
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
28
28
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
 
29
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
29
30
</head>
30
31
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
31
32
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="tools.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
39
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3426144" class="shortcut">Top</a>
40
 
                  &#160;|&#160;
41
 
                  <a href="#id3426218" class="shortcut">Description</a></nobr></td></tr>
 
40
<tr><td colspan="5" class="shortcuts">
 
41
<a href="#glib-Memory-Allocators.synopsis" class="shortcut">Top</a>
 
42
                 | 
 
43
                <a href="#glib-Memory-Allocators.description" class="shortcut">Description</a>
 
44
</td></tr>
42
45
</table>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Memory-Allocators"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
46
49
<td valign="top">
47
 
<h2>
48
 
<a name="id3426144"></a><span class="refentrytitle">Memory Allocators</span>
49
 
</h2>
50
 
<p>Memory Allocators &#8212; deprecated way to allocate chunks of memory for GList, GSList and GNode</p>
 
50
<h2><span class="refentrytitle"><a name="glib-Memory-Allocators.top_of_page"></a>Memory Allocators</span></h2>
 
51
<p>Memory Allocators — deprecated way to allocate chunks of memory for GList, GSList and GNode</p>
51
52
</td>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
55
 
<h2>Synopsis</h2>
 
56
<a name="glib-Memory-Allocators.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
57
58
 
58
59
#include &lt;glib.h&gt;
59
60
 
60
 
 
61
 
                    <a class="link" href="glib-Memory-Allocators.html#GAllocator">GAllocator</a>;
62
 
<a class="link" href="glib-Memory-Allocators.html#GAllocator">GAllocator</a>*         <a class="link" href="glib-Memory-Allocators.html#g-allocator-new">g_allocator_new</a>                     (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *name,
63
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> n_preallocs);
64
 
void                <a class="link" href="glib-Memory-Allocators.html#g-allocator-free">g_allocator_free</a>                    (<a class="link" href="glib-Memory-Allocators.html#GAllocator">GAllocator</a> *allocator);
65
 
 
 
61
                    <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator">GAllocator</a>;
 
62
<a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator">GAllocator</a>*         <a class="link" href="glib-Memory-Allocators.html#g-allocator-new" title="g_allocator_new ()">g_allocator_new</a>                     (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *name,
 
63
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_preallocs);
 
64
void                <a class="link" href="glib-Memory-Allocators.html#g-allocator-free" title="g_allocator_free ()">g_allocator_free</a>                    (<a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator">GAllocator</a> *allocator);
66
65
</pre>
67
66
</div>
68
67
<div class="refsect1" lang="en">
69
 
<a name="id3426218"></a><h2>Description</h2>
 
68
<a name="glib-Memory-Allocators.description"></a><h2>Description</h2>
70
69
<p>
71
70
</p>
72
71
<p>
73
 
Prior to 2.10, <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a> was used as an efficient way to allocate 
74
 
small pieces of memory for use with the <a class="link" href="glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a>, <a class="link" href="glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> and <a class="link" href="glib-N-ary-Trees.html#GNode"><span class="type">GNode</span></a> data 
75
 
structures. Since 2.10, it has been completely replaced by the 
 
72
Prior to 2.10, <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a> was used as an efficient way to allocate
 
73
small pieces of memory for use with the <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a>, <a class="link" href="glib-Singly-Linked-Lists.html#GSList" title="GSList"><span class="type">GSList</span></a> and <a class="link" href="glib-N-ary-Trees.html#GNode" title="GNode"><span class="type">GNode</span></a> data
 
74
structures. Since 2.10, it has been completely replaced by the
76
75
<a class="link" href="glib-Memory-Slices.html" title="Memory Slices">slice allocator</a> and deprecated.
77
76
</p>
78
77
</div>
79
78
<div class="refsect1" lang="en">
80
 
<a name="id3426277"></a><h2>Details</h2>
 
79
<a name="glib-Memory-Allocators.details"></a><h2>Details</h2>
81
80
<div class="refsect2" lang="en">
82
 
<a name="id3426287"></a><h3>
83
 
<a name="GAllocator"></a>GAllocator</h3>
84
 
<a class="indexterm" name="id3426302"></a><pre class="programlisting">typedef struct _GAllocator GAllocator;</pre>
 
81
<a name="GAllocator"></a><h3>GAllocator</h3>
 
82
<pre class="programlisting">typedef struct _GAllocator GAllocator;</pre>
85
83
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
86
84
<h3 class="title">Warning</h3>
87
85
<p><code class="literal">GAllocator</code> is deprecated and should not be used in newly-written code.</p>
88
86
</div>
89
87
<p>
90
 
The <span class="structname">GAllocator</span> struct contains private data. and 
 
88
The <span class="structname">GAllocator</span> struct contains private data. and
91
89
should only be accessed using the following functions.
92
90
</p>
93
91
</div>
94
92
<hr>
95
93
<div class="refsect2" lang="en">
96
 
<a name="id3426335"></a><h3>
97
 
<a name="g-allocator-new"></a>g_allocator_new ()</h3>
98
 
<a class="indexterm" name="id3426350"></a><pre class="programlisting"><a class="link" href="glib-Memory-Allocators.html#GAllocator">GAllocator</a>*         g_allocator_new                     (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *name,
99
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> n_preallocs);</pre>
 
94
<a name="g-allocator-new"></a><h3>g_allocator_new ()</h3>
 
95
<pre class="programlisting"><a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator">GAllocator</a>*         g_allocator_new                     (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *name,
 
96
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> n_preallocs);</pre>
100
97
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
101
98
<h3 class="title">Warning</h3>
102
99
<p><code class="literal">g_allocator_new</code> has been deprecated since version 2.10 and should not be used in newly-written code. Use the <a class="link" href="glib-Memory-Slices.html" title="Memory Slices">slice allocator</a>
103
100
instead</p>
104
101
</div>
105
102
<p>
106
 
Creates a new <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>.
 
103
Creates a new <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>.
107
104
</p>
108
105
<div class="variablelist"><table border="0">
109
106
<col align="left" valign="top">
110
107
<tbody>
111
108
<tr>
112
 
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
113
 
<td>the name of the <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>. This name is used to set the name of the
114
 
<a class="link" href="glib-Memory-Chunks.html#GMemChunk"><span class="type">GMemChunk</span></a> used by the <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>, and is only used for debugging.
 
109
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
 
110
<td>the name of the <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>. This name is used to set the name of the
 
111
<a class="link" href="glib-Memory-Chunks.html#GMemChunk" title="GMemChunk"><span class="type">GMemChunk</span></a> used by the <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>, and is only used for debugging.
115
112
</td>
116
113
</tr>
117
114
<tr>
118
 
<td><p><span class="term"><em class="parameter"><code>n_preallocs</code></em>&#160;:</span></p></td>
 
115
<td><p><span class="term"><em class="parameter"><code>n_preallocs</code></em> :</span></p></td>
119
116
<td>the number of elements in each block of memory allocated.
120
 
Larger blocks mean less calls to <a class="link" href="glib-Memory-Allocation.html#g-malloc"><code class="function">g_malloc()</code></a>, but some memory may be wasted.
 
117
Larger blocks mean less calls to <a class="link" href="glib-Memory-Allocation.html#g-malloc" title="g_malloc ()"><code class="function">g_malloc()</code></a>, but some memory may be wasted.
121
118
(GLib uses 128 elements per block by default.) The value must be between 1
122
119
and 65535.
123
120
</td>
124
121
</tr>
125
122
<tr>
126
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
127
 
<td>a new <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>.
 
123
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
124
<td>a new <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>.
128
125
</td>
129
126
</tr>
130
127
</tbody>
132
129
</div>
133
130
<hr>
134
131
<div class="refsect2" lang="en">
135
 
<a name="id3426503"></a><h3>
136
 
<a name="g-allocator-free"></a>g_allocator_free ()</h3>
137
 
<a class="indexterm" name="id3426518"></a><pre class="programlisting">void                g_allocator_free                    (<a class="link" href="glib-Memory-Allocators.html#GAllocator">GAllocator</a> *allocator);</pre>
 
132
<a name="g-allocator-free"></a><h3>g_allocator_free ()</h3>
 
133
<pre class="programlisting">void                g_allocator_free                    (<a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator">GAllocator</a> *allocator);</pre>
138
134
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
139
135
<h3 class="title">Warning</h3>
140
136
<p><code class="literal">g_allocator_free</code> has been deprecated since version 2.10 and should not be used in newly-written code. Use the <a class="link" href="glib-Memory-Slices.html" title="Memory Slices">slice allocator</a>
141
137
instead</p>
142
138
</div>
143
139
<p>
144
 
Frees all of the memory allocated by the <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>.
 
140
Frees all of the memory allocated by the <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>.
145
141
</p>
146
142
<div class="variablelist"><table border="0">
147
143
<col align="left" valign="top">
148
144
<tbody><tr>
149
 
<td><p><span class="term"><em class="parameter"><code>allocator</code></em>&#160;:</span></p></td>
150
 
<td>a <a class="link" href="glib-Memory-Allocators.html#GAllocator"><span class="type">GAllocator</span></a>.
 
145
<td><p><span class="term"><em class="parameter"><code>allocator</code></em> :</span></p></td>
 
146
<td>a <a class="link" href="glib-Memory-Allocators.html#GAllocator" title="GAllocator"><span class="type">GAllocator</span></a>.
151
147
</td>
152
148
</tr></tbody>
153
149
</table></div>
154
150
</div>
155
151
</div>
156
 
<div class="refsect1" lang="en">
157
 
<a name="id3426602"></a><div class="refsect2" lang="en"><a name="id3426604"></a></div>
 
152
</div>
 
153
<div class="footer">
158
154
<hr>
159
 
<div class="refsect2" lang="en"><a name="id3426605"></a></div>
160
 
</div>
161
 
</div>
 
155
          Generated by GTK-Doc V1.11</div>
162
156
</body>
163
157
</html>