Mon, 08 Aug 2022 17:12:00 +0200
#201 - remove dangerous allocator config
There is no plausible use case, except using the testing
allocator in the test case, and having the possibility to
specify any allocator (including another mempool) causes
more harm than good.
390 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | <head> | |
4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | |
5 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> | |
6 | <meta name="generator" content="Doxygen 1.8.13"/> | |
7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> | |
8 | <title>ucx: /home/mike/workspace/c/ucx/src/ucx/allocator.h File Reference</title> | |
9 | <link href="tabs.css" rel="stylesheet" type="text/css"/> | |
10 | <script type="text/javascript" src="jquery.js"></script> | |
11 | <script type="text/javascript" src="dynsections.js"></script> | |
12 | <link href="search/search.css" rel="stylesheet" type="text/css"/> | |
13 | <script type="text/javascript" src="search/searchdata.js"></script> | |
14 | <script type="text/javascript" src="search/search.js"></script> | |
15 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> | |
16 | </head> | |
17 | <body> | |
18 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> | |
19 | <div id="titlearea"> | |
20 | <table cellspacing="0" cellpadding="0"> | |
21 | <tbody> | |
22 | <tr style="height: 56px;"> | |
23 | <td id="projectlogo"><img alt="Logo" src="uaplogo.png"/></td> | |
24 | <td id="projectalign" style="padding-left: 0.5em;"> | |
25 | <div id="projectname">ucx | |
26 | </div> | |
27 | <div id="projectbrief">UAP Common Extensions</div> | |
28 | </td> | |
29 | </tr> | |
30 | </tbody> | |
31 | </table> | |
32 | </div> | |
33 | <!-- end header part --> | |
34 | <!-- Generated by Doxygen 1.8.13 --> | |
35 | <script type="text/javascript"> | |
36 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); | |
37 | </script> | |
38 | <script type="text/javascript" src="menudata.js"></script> | |
39 | <script type="text/javascript" src="menu.js"></script> | |
40 | <script type="text/javascript"> | |
41 | $(function() { | |
42 | initMenu('',true,false,'search.php','Search'); | |
43 | $(document).ready(function() { init_search(); }); | |
44 | }); | |
45 | </script> | |
46 | <div id="main-nav"></div> | |
47 | <!-- window showing the filter options --> | |
48 | <div id="MSearchSelectWindow" | |
49 | onmouseover="return searchBox.OnSearchSelectShow()" | |
50 | onmouseout="return searchBox.OnSearchSelectHide()" | |
51 | onkeydown="return searchBox.OnSearchSelectKey(event)"> | |
52 | </div> | |
53 | ||
54 | <!-- iframe showing the search results (closed by default) --> | |
55 | <div id="MSearchResultsWindow"> | |
56 | <iframe src="javascript:void(0)" frameborder="0" | |
57 | name="MSearchResults" id="MSearchResults"> | |
58 | </iframe> | |
59 | </div> | |
60 | ||
61 | <div id="nav-path" class="navpath"> | |
62 | <ul> | |
63 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_69f4ea29401808fe6229564976cde3ce.html">ucx</a></li> </ul> | |
64 | </div> | |
65 | </div><!-- top --> | |
66 | <div class="header"> | |
67 | <div class="summary"> | |
68 | <a href="#nested-classes">Data Structures</a> | | |
69 | <a href="#define-members">Macros</a> | | |
70 | <a href="#typedef-members">Typedefs</a> | | |
71 | <a href="#func-members">Functions</a> </div> | |
72 | <div class="headertitle"> | |
73 | <div class="title">allocator.h File Reference</div> </div> | |
74 | </div><!--header--> | |
75 | <div class="contents"> | |
76 | ||
77 | <p>Allocator for custom memory management. | |
78 | <a href="#details">More...</a></p> | |
79 | <div class="textblock"><code>#include "<a class="el" href="ucx_8h_source.html">ucx.h</a>"</code><br /> | |
80 | </div> | |
81 | <p><a href="allocator_8h_source.html">Go to the source code of this file.</a></p> | |
82 | <table class="memberdecls"> | |
83 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> | |
84 | Data Structures</h2></td></tr> | |
85 | <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structUcxAllocator.html">UcxAllocator</a></td></tr> | |
86 | <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">UCX allocator data structure containing memory management functions. <a href="structUcxAllocator.html#details">More...</a><br /></td></tr> | |
87 | <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> | |
88 | </table><table class="memberdecls"> | |
89 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> | |
90 | Macros</h2></td></tr> | |
91 | <tr class="memitem:ae1bc218fea8a35f4a3706f0beefcfb19"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#ae1bc218fea8a35f4a3706f0beefcfb19">almalloc</a>(allocator, n)   ((allocator)->malloc((allocator)->pool, n))</td></tr> | |
92 | <tr class="memdesc:ae1bc218fea8a35f4a3706f0beefcfb19"><td class="mdescLeft"> </td><td class="mdescRight">Shorthand for calling an allocators malloc function. <a href="#ae1bc218fea8a35f4a3706f0beefcfb19">More...</a><br /></td></tr> | |
93 | <tr class="separator:ae1bc218fea8a35f4a3706f0beefcfb19"><td class="memSeparator" colspan="2"> </td></tr> | |
94 | <tr class="memitem:a8d71470816f88f78cb9a9686c57e1b10"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a8d71470816f88f78cb9a9686c57e1b10">alcalloc</a>(allocator, n, size)   ((allocator)->calloc((allocator)->pool, n, size))</td></tr> | |
95 | <tr class="memdesc:a8d71470816f88f78cb9a9686c57e1b10"><td class="mdescLeft"> </td><td class="mdescRight">Shorthand for calling an allocators calloc function. <a href="#a8d71470816f88f78cb9a9686c57e1b10">More...</a><br /></td></tr> | |
96 | <tr class="separator:a8d71470816f88f78cb9a9686c57e1b10"><td class="memSeparator" colspan="2"> </td></tr> | |
97 | <tr class="memitem:a029ee5c9bcbb3f873571553f788c5820"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a029ee5c9bcbb3f873571553f788c5820">alrealloc</a>(allocator, ptr, n)   ((allocator)->realloc((allocator)->pool, ptr, n))</td></tr> | |
98 | <tr class="memdesc:a029ee5c9bcbb3f873571553f788c5820"><td class="mdescLeft"> </td><td class="mdescRight">Shorthand for calling an allocators realloc function. <a href="#a029ee5c9bcbb3f873571553f788c5820">More...</a><br /></td></tr> | |
99 | <tr class="separator:a029ee5c9bcbb3f873571553f788c5820"><td class="memSeparator" colspan="2"> </td></tr> | |
100 | <tr class="memitem:acd775785b54e97dc2b33a432c12c8fb2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#acd775785b54e97dc2b33a432c12c8fb2">alfree</a>(allocator, ptr)   ((allocator)->free((allocator)->pool, ptr))</td></tr> | |
101 | <tr class="memdesc:acd775785b54e97dc2b33a432c12c8fb2"><td class="mdescLeft"> </td><td class="mdescRight">Shorthand for calling an allocators free function. <a href="#acd775785b54e97dc2b33a432c12c8fb2">More...</a><br /></td></tr> | |
102 | <tr class="separator:acd775785b54e97dc2b33a432c12c8fb2"><td class="memSeparator" colspan="2"> </td></tr> | |
103 | <tr class="memitem:a1283a8f875f90a7af3aba5e031fc2e3f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a1283a8f875f90a7af3aba5e031fc2e3f">UCX_ALLOCATOR_DEFAULT</a></td></tr> | |
104 | <tr class="memdesc:a1283a8f875f90a7af3aba5e031fc2e3f"><td class="mdescLeft"> </td><td class="mdescRight">Convenient macro for a default allocator <code>struct</code> definition. <a href="#a1283a8f875f90a7af3aba5e031fc2e3f">More...</a><br /></td></tr> | |
105 | <tr class="separator:a1283a8f875f90a7af3aba5e031fc2e3f"><td class="memSeparator" colspan="2"> </td></tr> | |
106 | </table><table class="memberdecls"> | |
107 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> | |
108 | Typedefs</h2></td></tr> | |
109 | <tr class="memitem:a29f0f6a23a70db3b60635cd6dc384473"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a29f0f6a23a70db3b60635cd6dc384473">ucx_allocator_malloc</a>) (void *pool, size_t n)</td></tr> | |
110 | <tr class="memdesc:a29f0f6a23a70db3b60635cd6dc384473"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer to the allocators <code>malloc()</code> function. <a href="#a29f0f6a23a70db3b60635cd6dc384473">More...</a><br /></td></tr> | |
111 | <tr class="separator:a29f0f6a23a70db3b60635cd6dc384473"><td class="memSeparator" colspan="2"> </td></tr> | |
112 | <tr class="memitem:a2c0aba4221c1ac6801f03ed799f15b12"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a2c0aba4221c1ac6801f03ed799f15b12">ucx_allocator_calloc</a>) (void *pool, size_t n, size_t size)</td></tr> | |
113 | <tr class="memdesc:a2c0aba4221c1ac6801f03ed799f15b12"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer to the allocators <code>calloc()</code> function. <a href="#a2c0aba4221c1ac6801f03ed799f15b12">More...</a><br /></td></tr> | |
114 | <tr class="separator:a2c0aba4221c1ac6801f03ed799f15b12"><td class="memSeparator" colspan="2"> </td></tr> | |
115 | <tr class="memitem:a6d7cf038a806e327c5da37321d04e426"><td class="memItemLeft" align="right" valign="top">typedef void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a6d7cf038a806e327c5da37321d04e426">ucx_allocator_realloc</a>) (void *pool, void *data, size_t n)</td></tr> | |
116 | <tr class="memdesc:a6d7cf038a806e327c5da37321d04e426"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer to the allocators <code>realloc()</code> function. <a href="#a6d7cf038a806e327c5da37321d04e426">More...</a><br /></td></tr> | |
117 | <tr class="separator:a6d7cf038a806e327c5da37321d04e426"><td class="memSeparator" colspan="2"> </td></tr> | |
118 | <tr class="memitem:aaf2387ddaddd8ab4b267e6b00e5d6f7e"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#aaf2387ddaddd8ab4b267e6b00e5d6f7e">ucx_allocator_free</a>) (void *pool, void *data)</td></tr> | |
119 | <tr class="memdesc:aaf2387ddaddd8ab4b267e6b00e5d6f7e"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer to the allocators <code>free()</code> function. <a href="#aaf2387ddaddd8ab4b267e6b00e5d6f7e">More...</a><br /></td></tr> | |
120 | <tr class="separator:aaf2387ddaddd8ab4b267e6b00e5d6f7e"><td class="memSeparator" colspan="2"> </td></tr> | |
121 | </table><table class="memberdecls"> | |
122 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> | |
123 | Functions</h2></td></tr> | |
124 | <tr class="memitem:a98d2f1b341118b7a0e341fda5d8b2ebf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structUcxAllocator.html">UcxAllocator</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a98d2f1b341118b7a0e341fda5d8b2ebf">ucx_default_allocator</a> ()</td></tr> | |
125 | <tr class="memdesc:a98d2f1b341118b7a0e341fda5d8b2ebf"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the default allocator. <a href="#a98d2f1b341118b7a0e341fda5d8b2ebf">More...</a><br /></td></tr> | |
126 | <tr class="separator:a98d2f1b341118b7a0e341fda5d8b2ebf"><td class="memSeparator" colspan="2"> </td></tr> | |
127 | <tr class="memitem:a96403ebf3d2312d95f2fe7627a1cdbc0"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a96403ebf3d2312d95f2fe7627a1cdbc0">ucx_default_malloc</a> (void *ignore, size_t n)</td></tr> | |
128 | <tr class="memdesc:a96403ebf3d2312d95f2fe7627a1cdbc0"><td class="mdescLeft"> </td><td class="mdescRight">A wrapper for the standard libc <code>malloc()</code> function. <a href="#a96403ebf3d2312d95f2fe7627a1cdbc0">More...</a><br /></td></tr> | |
129 | <tr class="separator:a96403ebf3d2312d95f2fe7627a1cdbc0"><td class="memSeparator" colspan="2"> </td></tr> | |
130 | <tr class="memitem:a3a0bfdd13d887012309c459b339f338f"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a3a0bfdd13d887012309c459b339f338f">ucx_default_calloc</a> (void *ignore, size_t n, size_t size)</td></tr> | |
131 | <tr class="memdesc:a3a0bfdd13d887012309c459b339f338f"><td class="mdescLeft"> </td><td class="mdescRight">A wrapper for the standard libc <code>calloc()</code> function. <a href="#a3a0bfdd13d887012309c459b339f338f">More...</a><br /></td></tr> | |
132 | <tr class="separator:a3a0bfdd13d887012309c459b339f338f"><td class="memSeparator" colspan="2"> </td></tr> | |
133 | <tr class="memitem:a47cfc8af626a86fcb93a2b14b90498ed"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a47cfc8af626a86fcb93a2b14b90498ed">ucx_default_realloc</a> (void *ignore, void *data, size_t n)</td></tr> | |
134 | <tr class="memdesc:a47cfc8af626a86fcb93a2b14b90498ed"><td class="mdescLeft"> </td><td class="mdescRight">A wrapper for the standard libc <code>realloc()</code> function. <a href="#a47cfc8af626a86fcb93a2b14b90498ed">More...</a><br /></td></tr> | |
135 | <tr class="separator:a47cfc8af626a86fcb93a2b14b90498ed"><td class="memSeparator" colspan="2"> </td></tr> | |
136 | <tr class="memitem:a646d83aaaadfe33ae414c0fad8bfc52a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="allocator_8h.html#a646d83aaaadfe33ae414c0fad8bfc52a">ucx_default_free</a> (void *ignore, void *data)</td></tr> | |
137 | <tr class="memdesc:a646d83aaaadfe33ae414c0fad8bfc52a"><td class="mdescLeft"> </td><td class="mdescRight">A wrapper for the standard libc <code>free()</code> function. <a href="#a646d83aaaadfe33ae414c0fad8bfc52a">More...</a><br /></td></tr> | |
138 | <tr class="separator:a646d83aaaadfe33ae414c0fad8bfc52a"><td class="memSeparator" colspan="2"> </td></tr> | |
139 | </table> | |
140 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> | |
141 | <div class="textblock"><p>Allocator for custom memory management. </p> | |
142 | <p>A UCX allocator consists of a pointer to the memory area / pool and four function pointers to memory management functions operating on this memory area / pool. These functions shall behave equivalent to the standard libc functions <code>malloc(), calloc(), realloc()</code> and <code>free()</code>.</p> | |
143 | <p>The signature of the memory management functions is based on the signature of the respective libc function but each of them takes the pointer to the memory area / pool as first argument.</p> | |
144 | <p>As the pointer to the memory area / pool can be arbitrarily chosen, any data can be provided to the memory management functions. A <a class="el" href="structUcxMempool.html" title="UCX mempool structure. ">UcxMempool</a> is just one example.</p> | |
145 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="mempool_8h.html" title="Memory pool implementation. ">mempool.h</a> </dd> | |
146 | <dd> | |
147 | <a class="el" href="structUcxMap.html" title="Structure for the UCX map. ">UcxMap</a></dd></dl> | |
148 | <dl class="section author"><dt>Author</dt><dd>Mike Becker </dd> | |
149 | <dd> | |
150 | Olaf Wintermann </dd></dl> | |
151 | </div><h2 class="groupheader">Macro Definition Documentation</h2> | |
152 | <a id="a8d71470816f88f78cb9a9686c57e1b10"></a> | |
153 | <h2 class="memtitle"><span class="permalink"><a href="#a8d71470816f88f78cb9a9686c57e1b10">◆ </a></span>alcalloc</h2> | |
154 | ||
155 | <div class="memitem"> | |
156 | <div class="memproto"> | |
157 | <table class="memname"> | |
158 | <tr> | |
159 | <td class="memname">#define alcalloc</td> | |
160 | <td>(</td> | |
161 | <td class="paramtype"> </td> | |
162 | <td class="paramname">allocator, </td> | |
163 | </tr> | |
164 | <tr> | |
165 | <td class="paramkey"></td> | |
166 | <td></td> | |
167 | <td class="paramtype"> </td> | |
168 | <td class="paramname">n, </td> | |
169 | </tr> | |
170 | <tr> | |
171 | <td class="paramkey"></td> | |
172 | <td></td> | |
173 | <td class="paramtype"> </td> | |
174 | <td class="paramname">size </td> | |
175 | </tr> | |
176 | <tr> | |
177 | <td></td> | |
178 | <td>)</td> | |
179 | <td></td><td>   ((allocator)->calloc((allocator)->pool, n, size))</td> | |
180 | </tr> | |
181 | </table> | |
182 | </div><div class="memdoc"> | |
183 | ||
184 | <p>Shorthand for calling an allocators calloc function. </p> | |
185 | <dl class="params"><dt>Parameters</dt><dd> | |
186 | <table class="params"> | |
187 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
188 | <tr><td class="paramname">n</td><td>the count of elements the space should be allocated for </td></tr> | |
189 | <tr><td class="paramname">size</td><td>the size of each element </td></tr> | |
190 | </table> | |
191 | </dd> | |
192 | </dl> | |
193 | <dl class="section return"><dt>Returns</dt><dd>a pointer to the allocated memory area </dd></dl> | |
194 | ||
195 | </div> | |
196 | </div> | |
197 | <a id="acd775785b54e97dc2b33a432c12c8fb2"></a> | |
198 | <h2 class="memtitle"><span class="permalink"><a href="#acd775785b54e97dc2b33a432c12c8fb2">◆ </a></span>alfree</h2> | |
199 | ||
200 | <div class="memitem"> | |
201 | <div class="memproto"> | |
202 | <table class="memname"> | |
203 | <tr> | |
204 | <td class="memname">#define alfree</td> | |
205 | <td>(</td> | |
206 | <td class="paramtype"> </td> | |
207 | <td class="paramname">allocator, </td> | |
208 | </tr> | |
209 | <tr> | |
210 | <td class="paramkey"></td> | |
211 | <td></td> | |
212 | <td class="paramtype"> </td> | |
213 | <td class="paramname">ptr </td> | |
214 | </tr> | |
215 | <tr> | |
216 | <td></td> | |
217 | <td>)</td> | |
218 | <td></td><td>   ((allocator)->free((allocator)->pool, ptr))</td> | |
219 | </tr> | |
220 | </table> | |
221 | </div><div class="memdoc"> | |
222 | ||
223 | <p>Shorthand for calling an allocators free function. </p> | |
224 | <dl class="params"><dt>Parameters</dt><dd> | |
225 | <table class="params"> | |
226 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
227 | <tr><td class="paramname">ptr</td><td>the pointer to the memory area that shall be freed </td></tr> | |
228 | </table> | |
229 | </dd> | |
230 | </dl> | |
231 | ||
232 | </div> | |
233 | </div> | |
234 | <a id="ae1bc218fea8a35f4a3706f0beefcfb19"></a> | |
235 | <h2 class="memtitle"><span class="permalink"><a href="#ae1bc218fea8a35f4a3706f0beefcfb19">◆ </a></span>almalloc</h2> | |
236 | ||
237 | <div class="memitem"> | |
238 | <div class="memproto"> | |
239 | <table class="memname"> | |
240 | <tr> | |
241 | <td class="memname">#define almalloc</td> | |
242 | <td>(</td> | |
243 | <td class="paramtype"> </td> | |
244 | <td class="paramname">allocator, </td> | |
245 | </tr> | |
246 | <tr> | |
247 | <td class="paramkey"></td> | |
248 | <td></td> | |
249 | <td class="paramtype"> </td> | |
250 | <td class="paramname">n </td> | |
251 | </tr> | |
252 | <tr> | |
253 | <td></td> | |
254 | <td>)</td> | |
255 | <td></td><td>   ((allocator)->malloc((allocator)->pool, n))</td> | |
256 | </tr> | |
257 | </table> | |
258 | </div><div class="memdoc"> | |
259 | ||
260 | <p>Shorthand for calling an allocators malloc function. </p> | |
261 | <dl class="params"><dt>Parameters</dt><dd> | |
262 | <table class="params"> | |
263 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
264 | <tr><td class="paramname">n</td><td>size of space to allocate </td></tr> | |
265 | </table> | |
266 | </dd> | |
267 | </dl> | |
268 | <dl class="section return"><dt>Returns</dt><dd>a pointer to the allocated memory area </dd></dl> | |
269 | ||
270 | </div> | |
271 | </div> | |
272 | <a id="a029ee5c9bcbb3f873571553f788c5820"></a> | |
273 | <h2 class="memtitle"><span class="permalink"><a href="#a029ee5c9bcbb3f873571553f788c5820">◆ </a></span>alrealloc</h2> | |
274 | ||
275 | <div class="memitem"> | |
276 | <div class="memproto"> | |
277 | <table class="memname"> | |
278 | <tr> | |
279 | <td class="memname">#define alrealloc</td> | |
280 | <td>(</td> | |
281 | <td class="paramtype"> </td> | |
282 | <td class="paramname">allocator, </td> | |
283 | </tr> | |
284 | <tr> | |
285 | <td class="paramkey"></td> | |
286 | <td></td> | |
287 | <td class="paramtype"> </td> | |
288 | <td class="paramname">ptr, </td> | |
289 | </tr> | |
290 | <tr> | |
291 | <td class="paramkey"></td> | |
292 | <td></td> | |
293 | <td class="paramtype"> </td> | |
294 | <td class="paramname">n </td> | |
295 | </tr> | |
296 | <tr> | |
297 | <td></td> | |
298 | <td>)</td> | |
299 | <td></td><td>   ((allocator)->realloc((allocator)->pool, ptr, n))</td> | |
300 | </tr> | |
301 | </table> | |
302 | </div><div class="memdoc"> | |
303 | ||
304 | <p>Shorthand for calling an allocators realloc function. </p> | |
305 | <dl class="params"><dt>Parameters</dt><dd> | |
306 | <table class="params"> | |
307 | <tr><td class="paramname">allocator</td><td>the allocator to use </td></tr> | |
308 | <tr><td class="paramname">ptr</td><td>the pointer to the memory area that shall be reallocated </td></tr> | |
309 | <tr><td class="paramname">n</td><td>the new size of the allocated memory area </td></tr> | |
310 | </table> | |
311 | </dd> | |
312 | </dl> | |
313 | <dl class="section return"><dt>Returns</dt><dd>a pointer to the reallocated memory area </dd></dl> | |
314 | ||
315 | </div> | |
316 | </div> | |
317 | <a id="a1283a8f875f90a7af3aba5e031fc2e3f"></a> | |
318 | <h2 class="memtitle"><span class="permalink"><a href="#a1283a8f875f90a7af3aba5e031fc2e3f">◆ </a></span>UCX_ALLOCATOR_DEFAULT</h2> | |
319 | ||
320 | <div class="memitem"> | |
321 | <div class="memproto"> | |
322 | <table class="memname"> | |
323 | <tr> | |
324 | <td class="memname">#define UCX_ALLOCATOR_DEFAULT</td> | |
325 | </tr> | |
326 | </table> | |
327 | </div><div class="memdoc"> | |
328 | <b>Value:</b><div class="fragment"><div class="line">{NULL, \</div><div class="line"> ucx_default_malloc, <a class="code" href="allocator_8h.html#a3a0bfdd13d887012309c459b339f338f">ucx_default_calloc</a>, <a class="code" href="allocator_8h.html#a47cfc8af626a86fcb93a2b14b90498ed">ucx_default_realloc</a>, \</div><div class="line"> ucx_default_free }</div><div class="ttc" id="allocator_8h_html_a3a0bfdd13d887012309c459b339f338f"><div class="ttname"><a href="allocator_8h.html#a3a0bfdd13d887012309c459b339f338f">ucx_default_calloc</a></div><div class="ttdeci">void * ucx_default_calloc(void *ignore, size_t n, size_t size)</div><div class="ttdoc">A wrapper for the standard libc calloc() function. </div><div class="ttdef"><b>Definition:</b> allocator.c:50</div></div> | |
329 | <div class="ttc" id="allocator_8h_html_a47cfc8af626a86fcb93a2b14b90498ed"><div class="ttname"><a href="allocator_8h.html#a47cfc8af626a86fcb93a2b14b90498ed">ucx_default_realloc</a></div><div class="ttdeci">void * ucx_default_realloc(void *ignore, void *data, size_t n)</div><div class="ttdoc">A wrapper for the standard libc realloc() function. </div><div class="ttdef"><b>Definition:</b> allocator.c:54</div></div> | |
330 | </div><!-- fragment --> | |
331 | <p>Convenient macro for a default allocator <code>struct</code> definition. </p> | |
332 | ||
333 | </div> | |
334 | </div> | |
335 | <h2 class="groupheader">Typedef Documentation</h2> | |
336 | <a id="a2c0aba4221c1ac6801f03ed799f15b12"></a> | |
337 | <h2 class="memtitle"><span class="permalink"><a href="#a2c0aba4221c1ac6801f03ed799f15b12">◆ </a></span>ucx_allocator_calloc</h2> | |
338 | ||
339 | <div class="memitem"> | |
340 | <div class="memproto"> | |
341 | <table class="memname"> | |
342 | <tr> | |
343 | <td class="memname">typedef void*(* ucx_allocator_calloc) (void *pool, size_t n, size_t size)</td> | |
344 | </tr> | |
345 | </table> | |
346 | </div><div class="memdoc"> | |
347 | ||
348 | <p>A function pointer to the allocators <code>calloc()</code> function. </p> | |
349 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> </dd></dl> | |
350 | ||
351 | </div> | |
352 | </div> | |
353 | <a id="aaf2387ddaddd8ab4b267e6b00e5d6f7e"></a> | |
354 | <h2 class="memtitle"><span class="permalink"><a href="#aaf2387ddaddd8ab4b267e6b00e5d6f7e">◆ </a></span>ucx_allocator_free</h2> | |
355 | ||
356 | <div class="memitem"> | |
357 | <div class="memproto"> | |
358 | <table class="memname"> | |
359 | <tr> | |
360 | <td class="memname">typedef void(* ucx_allocator_free) (void *pool, void *data)</td> | |
361 | </tr> | |
362 | </table> | |
363 | </div><div class="memdoc"> | |
364 | ||
365 | <p>A function pointer to the allocators <code>free()</code> function. </p> | |
366 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> </dd></dl> | |
367 | ||
368 | </div> | |
369 | </div> | |
370 | <a id="a29f0f6a23a70db3b60635cd6dc384473"></a> | |
371 | <h2 class="memtitle"><span class="permalink"><a href="#a29f0f6a23a70db3b60635cd6dc384473">◆ </a></span>ucx_allocator_malloc</h2> | |
372 | ||
373 | <div class="memitem"> | |
374 | <div class="memproto"> | |
375 | <table class="memname"> | |
376 | <tr> | |
377 | <td class="memname">typedef void*(* ucx_allocator_malloc) (void *pool, size_t n)</td> | |
378 | </tr> | |
379 | </table> | |
380 | </div><div class="memdoc"> | |
381 | ||
382 | <p>A function pointer to the allocators <code>malloc()</code> function. </p> | |
383 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> </dd></dl> | |
384 | ||
385 | </div> | |
386 | </div> | |
387 | <a id="a6d7cf038a806e327c5da37321d04e426"></a> | |
388 | <h2 class="memtitle"><span class="permalink"><a href="#a6d7cf038a806e327c5da37321d04e426">◆ </a></span>ucx_allocator_realloc</h2> | |
389 | ||
390 | <div class="memitem"> | |
391 | <div class="memproto"> | |
392 | <table class="memname"> | |
393 | <tr> | |
394 | <td class="memname">typedef void*(* ucx_allocator_realloc) (void *pool, void *data, size_t n)</td> | |
395 | </tr> | |
396 | </table> | |
397 | </div><div class="memdoc"> | |
398 | ||
399 | <p>A function pointer to the allocators <code>realloc()</code> function. </p> | |
400 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> </dd></dl> | |
401 | ||
402 | </div> | |
403 | </div> | |
404 | <h2 class="groupheader">Function Documentation</h2> | |
405 | <a id="a98d2f1b341118b7a0e341fda5d8b2ebf"></a> | |
406 | <h2 class="memtitle"><span class="permalink"><a href="#a98d2f1b341118b7a0e341fda5d8b2ebf">◆ </a></span>ucx_default_allocator()</h2> | |
407 | ||
408 | <div class="memitem"> | |
409 | <div class="memproto"> | |
410 | <table class="memname"> | |
411 | <tr> | |
412 | <td class="memname"><a class="el" href="structUcxAllocator.html">UcxAllocator</a>* ucx_default_allocator </td> | |
413 | <td>(</td> | |
414 | <td class="paramname"></td><td>)</td> | |
415 | <td></td> | |
416 | </tr> | |
417 | </table> | |
418 | </div><div class="memdoc"> | |
419 | ||
420 | <p>Returns a pointer to the default allocator. </p> | |
421 | <p>The default allocator contains wrappers to the standard libc memory management functions. Use this function to get a pointer to a globally available allocator. You may also define an own <a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> by assigning <a class="el" href="allocator_8h.html#a1283a8f875f90a7af3aba5e031fc2e3f" title="Convenient macro for a default allocator struct definition. ">UCX_ALLOCATOR_DEFAULT</a> to a variable and pass the address of this variable to any function that takes a <a class="el" href="structUcxAllocator.html" title="UCX allocator data structure containing memory management functions. ">UcxAllocator</a> as argument. Note that using this function is the recommended way of passing a default allocator, thus it never runs out of scope.</p> | |
422 | <dl class="section return"><dt>Returns</dt><dd>a pointer to the default allocator</dd></dl> | |
423 | <dl class="section see"><dt>See also</dt><dd><a class="el" href="allocator_8h.html#a1283a8f875f90a7af3aba5e031fc2e3f" title="Convenient macro for a default allocator struct definition. ">UCX_ALLOCATOR_DEFAULT</a> </dd></dl> | |
424 | ||
425 | </div> | |
426 | </div> | |
427 | <a id="a3a0bfdd13d887012309c459b339f338f"></a> | |
428 | <h2 class="memtitle"><span class="permalink"><a href="#a3a0bfdd13d887012309c459b339f338f">◆ </a></span>ucx_default_calloc()</h2> | |
429 | ||
430 | <div class="memitem"> | |
431 | <div class="memproto"> | |
432 | <table class="memname"> | |
433 | <tr> | |
434 | <td class="memname">void* ucx_default_calloc </td> | |
435 | <td>(</td> | |
436 | <td class="paramtype">void * </td> | |
437 | <td class="paramname"><em>ignore</em>, </td> | |
438 | </tr> | |
439 | <tr> | |
440 | <td class="paramkey"></td> | |
441 | <td></td> | |
442 | <td class="paramtype">size_t </td> | |
443 | <td class="paramname"><em>n</em>, </td> | |
444 | </tr> | |
445 | <tr> | |
446 | <td class="paramkey"></td> | |
447 | <td></td> | |
448 | <td class="paramtype">size_t </td> | |
449 | <td class="paramname"><em>size</em> </td> | |
450 | </tr> | |
451 | <tr> | |
452 | <td></td> | |
453 | <td>)</td> | |
454 | <td></td><td></td> | |
455 | </tr> | |
456 | </table> | |
457 | </div><div class="memdoc"> | |
458 | ||
459 | <p>A wrapper for the standard libc <code>calloc()</code> function. </p> | |
460 | <dl class="params"><dt>Parameters</dt><dd> | |
461 | <table class="params"> | |
462 | <tr><td class="paramname">ignore</td><td>ignored (may be used by allocators for pooled memory) </td></tr> | |
463 | <tr><td class="paramname">n</td><td>argument passed to <code>calloc()</code> </td></tr> | |
464 | <tr><td class="paramname">size</td><td>argument passed to <code>calloc()</code> </td></tr> | |
465 | </table> | |
466 | </dd> | |
467 | </dl> | |
468 | <dl class="section return"><dt>Returns</dt><dd>return value of <code>calloc()</code> </dd></dl> | |
469 | ||
470 | </div> | |
471 | </div> | |
472 | <a id="a646d83aaaadfe33ae414c0fad8bfc52a"></a> | |
473 | <h2 class="memtitle"><span class="permalink"><a href="#a646d83aaaadfe33ae414c0fad8bfc52a">◆ </a></span>ucx_default_free()</h2> | |
474 | ||
475 | <div class="memitem"> | |
476 | <div class="memproto"> | |
477 | <table class="memname"> | |
478 | <tr> | |
479 | <td class="memname">void ucx_default_free </td> | |
480 | <td>(</td> | |
481 | <td class="paramtype">void * </td> | |
482 | <td class="paramname"><em>ignore</em>, </td> | |
483 | </tr> | |
484 | <tr> | |
485 | <td class="paramkey"></td> | |
486 | <td></td> | |
487 | <td class="paramtype">void * </td> | |
488 | <td class="paramname"><em>data</em> </td> | |
489 | </tr> | |
490 | <tr> | |
491 | <td></td> | |
492 | <td>)</td> | |
493 | <td></td><td></td> | |
494 | </tr> | |
495 | </table> | |
496 | </div><div class="memdoc"> | |
497 | ||
498 | <p>A wrapper for the standard libc <code>free()</code> function. </p> | |
499 | <dl class="params"><dt>Parameters</dt><dd> | |
500 | <table class="params"> | |
501 | <tr><td class="paramname">ignore</td><td>ignored (may be used by allocators for pooled memory) </td></tr> | |
502 | <tr><td class="paramname">data</td><td>argument passed to <code>free()</code> </td></tr> | |
503 | </table> | |
504 | </dd> | |
505 | </dl> | |
506 | ||
507 | </div> | |
508 | </div> | |
509 | <a id="a96403ebf3d2312d95f2fe7627a1cdbc0"></a> | |
510 | <h2 class="memtitle"><span class="permalink"><a href="#a96403ebf3d2312d95f2fe7627a1cdbc0">◆ </a></span>ucx_default_malloc()</h2> | |
511 | ||
512 | <div class="memitem"> | |
513 | <div class="memproto"> | |
514 | <table class="memname"> | |
515 | <tr> | |
516 | <td class="memname">void* ucx_default_malloc </td> | |
517 | <td>(</td> | |
518 | <td class="paramtype">void * </td> | |
519 | <td class="paramname"><em>ignore</em>, </td> | |
520 | </tr> | |
521 | <tr> | |
522 | <td class="paramkey"></td> | |
523 | <td></td> | |
524 | <td class="paramtype">size_t </td> | |
525 | <td class="paramname"><em>n</em> </td> | |
526 | </tr> | |
527 | <tr> | |
528 | <td></td> | |
529 | <td>)</td> | |
530 | <td></td><td></td> | |
531 | </tr> | |
532 | </table> | |
533 | </div><div class="memdoc"> | |
534 | ||
535 | <p>A wrapper for the standard libc <code>malloc()</code> function. </p> | |
536 | <dl class="params"><dt>Parameters</dt><dd> | |
537 | <table class="params"> | |
538 | <tr><td class="paramname">ignore</td><td>ignored (may be used by allocators for pooled memory) </td></tr> | |
539 | <tr><td class="paramname">n</td><td>argument passed to <code>malloc()</code> </td></tr> | |
540 | </table> | |
541 | </dd> | |
542 | </dl> | |
543 | <dl class="section return"><dt>Returns</dt><dd>return value of <code>malloc()</code> </dd></dl> | |
544 | ||
545 | </div> | |
546 | </div> | |
547 | <a id="a47cfc8af626a86fcb93a2b14b90498ed"></a> | |
548 | <h2 class="memtitle"><span class="permalink"><a href="#a47cfc8af626a86fcb93a2b14b90498ed">◆ </a></span>ucx_default_realloc()</h2> | |
549 | ||
550 | <div class="memitem"> | |
551 | <div class="memproto"> | |
552 | <table class="memname"> | |
553 | <tr> | |
554 | <td class="memname">void* ucx_default_realloc </td> | |
555 | <td>(</td> | |
556 | <td class="paramtype">void * </td> | |
557 | <td class="paramname"><em>ignore</em>, </td> | |
558 | </tr> | |
559 | <tr> | |
560 | <td class="paramkey"></td> | |
561 | <td></td> | |
562 | <td class="paramtype">void * </td> | |
563 | <td class="paramname"><em>data</em>, </td> | |
564 | </tr> | |
565 | <tr> | |
566 | <td class="paramkey"></td> | |
567 | <td></td> | |
568 | <td class="paramtype">size_t </td> | |
569 | <td class="paramname"><em>n</em> </td> | |
570 | </tr> | |
571 | <tr> | |
572 | <td></td> | |
573 | <td>)</td> | |
574 | <td></td><td></td> | |
575 | </tr> | |
576 | </table> | |
577 | </div><div class="memdoc"> | |
578 | ||
579 | <p>A wrapper for the standard libc <code>realloc()</code> function. </p> | |
580 | <dl class="params"><dt>Parameters</dt><dd> | |
581 | <table class="params"> | |
582 | <tr><td class="paramname">ignore</td><td>ignored (may be used by allocators for pooled memory) </td></tr> | |
583 | <tr><td class="paramname">data</td><td>argumend passed to <code>realloc()</code> </td></tr> | |
584 | <tr><td class="paramname">n</td><td>argument passed to <code>realloc()</code> </td></tr> | |
585 | </table> | |
586 | </dd> | |
587 | </dl> | |
588 | <dl class="section return"><dt>Returns</dt><dd>return value of <code>realloc()</code> </dd></dl> | |
589 | ||
590 | </div> | |
591 | </div> | |
592 | </div><!-- contents --> | |
593 | <!-- start footer part --> | |
594 | <hr class="footer"/><address class="footer"><small> | |
595 | Generated on Thu Dec 19 2019 19:58:24 for ucx by  <a href="http://www.doxygen.org/index.html"> | |
596 | <img class="footer" src="doxygen.png" alt="doxygen"/> | |
597 | </a> 1.8.13 | |
598 | </small></address> | |
599 | </body> | |
600 | </html> |