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

« back to all changes in this revision

Viewing changes to docs/reference/glib/xml/trash_stack.xml

  • 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
<refentry id="glib-Trash-Stacks">
2
2
<refmeta>
3
 
<refentrytitle role="top_of_page">Trash Stacks</refentrytitle>
 
3
<refentrytitle role="top_of_page" id="glib-Trash-Stacks.top_of_page">Trash Stacks</refentrytitle>
4
4
<manvolnum>3</manvolnum>
5
5
<refmiscinfo>GLIB Library</refmiscinfo>
6
6
</refmeta>
8
8
<refnamediv>
9
9
<refname>Trash Stacks</refname>
10
10
<refpurpose>maintain a stack of unused allocated memory chunks</refpurpose>
11
 
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
12
11
</refnamediv>
13
12
 
14
 
<refsynopsisdiv role="synopsis">
 
13
<refsynopsisdiv id="glib-Trash-Stacks.synopsis" role="synopsis">
15
14
<title role="synopsis.title">Synopsis</title>
16
15
 
17
16
<synopsis>
18
17
 
19
18
#include &lt;glib.h&gt;
20
19
 
21
 
 
22
20
                    <link linkend="GTrashStack">GTrashStack</link>;
23
21
<link linkend="void">void</link>                <link linkend="g-trash-stack-push">g_trash_stack_push</link>                  (<link linkend="GTrashStack">GTrashStack</link> **stack_p,
24
22
                                                         <link linkend="gpointer">gpointer</link> data_p);
36
34
 
37
35
 
38
36
 
39
 
<refsect1 role="desc">
 
37
<refsect1 id="glib-Trash-Stacks.description" role="desc">
40
38
<title role="desc.title">Description</title>
41
39
<para>
42
40
A <link linkend="GTrashStack"><type>GTrashStack</type></link> is an efficient way to keep a stack of unused allocated
45
43
overhead, since the stack pointers can be stored inside the memory chunks.
46
44
</para>
47
45
<para>
48
 
There is no function to create a <link linkend="GTrashStack"><type>GTrashStack</type></link>. A <link linkend="NULL:CAPS"><literal>NULL</literal></link> <link linkend="GTrashStack"><type>GTrashStack</type></link>* 
 
46
There is no function to create a <link linkend="GTrashStack"><type>GTrashStack</type></link>. A <link linkend="NULL--CAPS"><literal>NULL</literal></link> <link linkend="GTrashStack"><type>GTrashStack</type></link>*
49
47
is a perfectly valid empty stack.
50
48
</para>
51
49
</refsect1>
52
50
 
53
 
<refsect1 role="details">
 
51
<refsect1 id="glib-Trash-Stacks.details" role="details">
54
52
<title role="details.title">Details</title>
55
 
<refsect2>
56
 
<title><anchor id="GTrashStack" role="struct"/>GTrashStack</title>
57
 
<indexterm><primary>GTrashStack</primary></indexterm><programlisting>typedef struct {
 
53
<refsect2 id="GTrashStack" role="struct">
 
54
<title>GTrashStack</title>
 
55
<indexterm zone="GTrashStack"><primary sortas="GTrashStack">GTrashStack</primary></indexterm><programlisting>typedef struct {
58
56
  GTrashStack *next;
59
57
} GTrashStack;
60
58
</programlisting>
63
61
is cast to a <structname>GTrashStack*</structname>.
64
62
</para><variablelist role="struct">
65
63
<varlistentry>
66
 
<term><link linkend="GTrashStack">GTrashStack</link>&nbsp;*<structfield>next</structfield>;</term>
 
64
<term><link linkend="GTrashStack">GTrashStack</link>&#160;*<structfield>next</structfield>;</term>
67
65
<listitem><simpara>pointer to the previous element of the stack,
68
66
gets stored in the first <literal>sizeof (gpointer)</literal>
69
67
bytes of the element.
70
 
 
71
68
</simpara></listitem>
72
69
</varlistentry>
73
70
</variablelist></refsect2>
74
 
<refsect2>
75
 
<title><anchor id="g-trash-stack-push" role="function"/>g_trash_stack_push ()</title>
76
 
<indexterm><primary>g_trash_stack_push</primary></indexterm><programlisting><link linkend="void">void</link>                g_trash_stack_push                  (<link linkend="GTrashStack">GTrashStack</link> **stack_p,
 
71
<refsect2 id="g-trash-stack-push" role="function">
 
72
<title>g_trash_stack_push ()</title>
 
73
<indexterm zone="g-trash-stack-push"><primary sortas="g_trash_stack_push">g_trash_stack_push</primary></indexterm><programlisting><link linkend="void">void</link>                g_trash_stack_push                  (<link linkend="GTrashStack">GTrashStack</link> **stack_p,
77
74
                                                         <link linkend="gpointer">gpointer</link> data_p);</programlisting>
78
75
<para>
79
76
Pushes a piece of memory onto a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
80
77
</para><variablelist role="params">
81
 
<varlistentry><term><parameter>stack_p</parameter>&nbsp;:</term>
 
78
<varlistentry><term><parameter>stack_p</parameter>&#160;:</term>
82
79
<listitem><simpara>a pointer to a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
83
80
</simpara></listitem></varlistentry>
84
 
<varlistentry><term><parameter>data_p</parameter>&nbsp;:</term>
 
81
<varlistentry><term><parameter>data_p</parameter>&#160;:</term>
85
82
<listitem><simpara>the piece of memory to push on the stack.
86
 
 
87
 
 
88
83
</simpara></listitem></varlistentry>
89
84
</variablelist></refsect2>
90
 
<refsect2>
91
 
<title><anchor id="g-trash-stack-pop" role="function"/>g_trash_stack_pop ()</title>
92
 
<indexterm><primary>g_trash_stack_pop</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_trash_stack_pop                   (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
 
85
<refsect2 id="g-trash-stack-pop" role="function">
 
86
<title>g_trash_stack_pop ()</title>
 
87
<indexterm zone="g-trash-stack-pop"><primary sortas="g_trash_stack_pop">g_trash_stack_pop</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_trash_stack_pop                   (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
93
88
<para>
94
89
Pops a piece of memory off a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
95
90
</para><variablelist role="params">
96
 
<varlistentry><term><parameter>stack_p</parameter>&nbsp;:</term>
 
91
<varlistentry><term><parameter>stack_p</parameter>&#160;:</term>
97
92
<listitem><simpara>a pointer to a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
98
93
</simpara></listitem></varlistentry>
99
 
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the element at the top of the stack.
100
 
 
101
 
 
 
94
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the element at the top of the stack.
102
95
</simpara></listitem></varlistentry>
103
96
</variablelist></refsect2>
104
 
<refsect2>
105
 
<title><anchor id="g-trash-stack-peek" role="function"/>g_trash_stack_peek ()</title>
106
 
<indexterm><primary>g_trash_stack_peek</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_trash_stack_peek                  (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
 
97
<refsect2 id="g-trash-stack-peek" role="function">
 
98
<title>g_trash_stack_peek ()</title>
 
99
<indexterm zone="g-trash-stack-peek"><primary sortas="g_trash_stack_peek">g_trash_stack_peek</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_trash_stack_peek                  (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
107
100
<para>
108
 
Returns the element at the top of a <link linkend="GTrashStack"><type>GTrashStack</type></link> which may be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
 
101
Returns the element at the top of a <link linkend="GTrashStack"><type>GTrashStack</type></link> which may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
109
102
</para><variablelist role="params">
110
 
<varlistentry><term><parameter>stack_p</parameter>&nbsp;:</term>
 
103
<varlistentry><term><parameter>stack_p</parameter>&#160;:</term>
111
104
<listitem><simpara>a pointer to a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
112
105
</simpara></listitem></varlistentry>
113
 
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the element at the top of the stack.
114
 
 
115
 
 
 
106
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the element at the top of the stack.
116
107
</simpara></listitem></varlistentry>
117
108
</variablelist></refsect2>
118
 
<refsect2>
119
 
<title><anchor id="g-trash-stack-height" role="function"/>g_trash_stack_height ()</title>
120
 
<indexterm><primary>g_trash_stack_height</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_trash_stack_height                (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
 
109
<refsect2 id="g-trash-stack-height" role="function">
 
110
<title>g_trash_stack_height ()</title>
 
111
<indexterm zone="g-trash-stack-height"><primary sortas="g_trash_stack_height">g_trash_stack_height</primary></indexterm><programlisting><link linkend="guint">guint</link>               g_trash_stack_height                (<link linkend="GTrashStack">GTrashStack</link> **stack_p);</programlisting>
121
112
<para>
122
113
Returns the height of a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
123
114
Note that execution of this function is of O(N) complexity
124
115
where N denotes the number of items on the stack.
125
116
</para><variablelist role="params">
126
 
<varlistentry><term><parameter>stack_p</parameter>&nbsp;:</term>
 
117
<varlistentry><term><parameter>stack_p</parameter>&#160;:</term>
127
118
<listitem><simpara>a pointer to a <link linkend="GTrashStack"><type>GTrashStack</type></link>.
128
119
</simpara></listitem></varlistentry>
129
 
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the height of the stack.
130
 
 
131
 
 
 
120
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the height of the stack.
132
121
</simpara></listitem></varlistentry>
133
122
</variablelist></refsect2>
134
123
 
137
126
 
138
127
 
139
128
 
140
 
 
141
 
<refsect1><refsect2 /><refsect2 /></refsect1>
142
129
</refentry>