summaryrefslogtreecommitdiffstats
path: root/runtime/docs/html/alloc_8h.html
blob: 6a5db5ab2dbf1e26be67fcec8bad0f768d2d4bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>SystemTap: SystemTap Runtime Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div>

<!-- Generated by Doxygen 1.3.9.1 -->
<h1>alloc.h File Reference</h1>
<p>
<a href="alloc_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a7">errorcode</a> { <a class="el" href="alloc_8h.html#a7a0">ERR_NONE</a> = 0, 
<a class="el" href="alloc_8h.html#a7a1">ERR_NO_MEM</a>
 }</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a2">_stp_alloc</a> (size_t len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates memory within a probe.  <a href="#a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a3">_stp_calloc</a> (size_t len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates and clears memory within a probe.  <a href="#a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a4">_stp_valloc</a> (size_t len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates and clears memory outside a probe.  <a href="#a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a5">_stp_free</a> (void *ptr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees memory allocated by _stp_alloc or _stp_calloc.  <a href="#a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="alloc_8h.html#a6">_stp_vfree</a> (void *ptr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees memory allocated by _stp_valloc.  <a href="#a6"></a><br></td></tr>
</table>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="a7" doxytag="alloc.h::errorcode"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">enum <a class="el" href="alloc_8h.html#a7">errorcode</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="a7a0" doxytag="ERR_NONE"></a>ERR_NONE</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="a7a1" doxytag="ERR_NO_MEM"></a>ERR_NO_MEM</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00001">1</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a2" doxytag="alloc.h::_stp_alloc"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* _stp_alloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>len</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Allocates memory within a probe. 
<p>
This is used for small allocations from within a running probe where the process cannot sleep. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>Number of bytes to allocate. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl>
<dl compact><dt><b><a class="el" href="bug.html#_bug000001">Bug:</a></b></dt><dd>Currently uses kmalloc (GFP_ATOMIC). </dd></dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00012">12</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.
<p>
Referenced by <a class="el" href="alloc_8h-source.html#l00028">_stp_calloc()</a>, and <a class="el" href="map_8c-source.html#l00548">_stp_map_set_str()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a3" doxytag="alloc.h::_stp_calloc"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* _stp_calloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>len</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Allocates and clears memory within a probe. 
<p>
This is used for small allocations from within a running probe where the process cannot sleep. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>Number of bytes to allocate. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl>
<dl compact><dt><b><a class="el" href="bug.html#_bug000002">Bug:</a></b></dt><dd>Currently uses kmalloc (GFP_ATOMIC). </dd></dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00028">28</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.
<p>
References <a class="el" href="alloc_8h-source.html#l00012">_stp_alloc()</a>.
<p>
Referenced by <a class="el" href="map_8c-source.html#l00471">_stp_map_set_int64()</a>, <a class="el" href="map_8c-source.html#l00633">_stp_map_set_stat()</a>, and <a class="el" href="map_8c-source.html#l00548">_stp_map_set_str()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a5" doxytag="alloc.h::_stp_free"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void _stp_free           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>ptr</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Frees memory allocated by _stp_alloc or _stp_calloc. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>pointer to memory to free </td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00057">57</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.
<p>
Referenced by <a class="el" href="map_8c-source.html#l00765">_stp_list_clear()</a>, <a class="el" href="map_8c-source.html#l00104">_stp_map_key_del()</a>, and <a class="el" href="map_8c-source.html#l00548">_stp_map_set_str()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a4" doxytag="alloc.h::_stp_valloc"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void* _stp_valloc           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>len</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Allocates and clears memory outside a probe. 
<p>
This is typically used in the module initialization to allocate new maps, lists, etc. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>Number of bytes to allocate. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a valid pointer on success or NULL on failure. </dd></dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00043">43</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.
<p>
Referenced by <a class="el" href="map_8c-source.html#l00043">_stp_map_new()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a6" doxytag="alloc.h::_stp_vfree"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void _stp_vfree           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>ptr</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Frees memory allocated by _stp_valloc. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>pointer to memory to free </td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="alloc_8h-source.html#l00067">67</a> of file <a class="el" href="alloc_8h-source.html">alloc.h</a>.
<p>
Referenced by <a class="el" href="map_8c-source.html#l00190">_stp_map_del()</a>.    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Wed Mar 9 13:21:28 2005 for SystemTap by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>