docs/api-2.1/mempool_8h.html

Tue, 05 Oct 2021 11:19:32 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 05 Oct 2021 11:19:32 +0200
changeset 460
e075009b33b7
parent 390
d345541018fa
permissions
-rw-r--r--

remove convenience macros

Users should write their own wrappers s.t. the type
information does not have to be repeated on every
call site.

390
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 <html xmlns="http://www.w3.org/1999/xhtml">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 <head>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 <meta name="generator" content="Doxygen 1.8.13"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 <title>ucx: /home/mike/workspace/c/ucx/src/ucx/mempool.h File Reference</title>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 <script type="text/javascript" src="jquery.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 <script type="text/javascript" src="dynsections.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 <link href="search/search.css" rel="stylesheet" type="text/css"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 <script type="text/javascript" src="search/searchdata.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 <script type="text/javascript" src="search/search.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 <link href="doxygen.css" rel="stylesheet" type="text/css" />
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 </head>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 <body>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 <div id="titlearea">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 <table cellspacing="0" cellpadding="0">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 <tbody>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 <tr style="height: 56px;">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 <td id="projectlogo"><img alt="Logo" src="uaplogo.png"/></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 <td id="projectalign" style="padding-left: 0.5em;">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 <div id="projectname">ucx
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 <div id="projectbrief">UAP Common Extensions</div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 </tbody>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33 <!-- end header part -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 <!-- Generated by Doxygen 1.8.13 -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 <script type="text/javascript">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 var searchBox = new SearchBox("searchBox", "search",false,'Search');
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37 </script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 <script type="text/javascript" src="menudata.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 <script type="text/javascript" src="menu.js"></script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 <script type="text/javascript">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 $(function() {
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 initMenu('',true,false,'search.php','Search');
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 $(document).ready(function() { init_search(); });
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 });
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 </script>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46 <div id="main-nav"></div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 <!-- window showing the filter options -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 <div id="MSearchSelectWindow"
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 onmouseover="return searchBox.OnSearchSelectShow()"
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 onmouseout="return searchBox.OnSearchSelectHide()"
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 onkeydown="return searchBox.OnSearchSelectKey(event)">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 <!-- iframe showing the search results (closed by default) -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55 <div id="MSearchResultsWindow">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 <iframe src="javascript:void(0)" frameborder="0"
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 name="MSearchResults" id="MSearchResults">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 </iframe>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 <div id="nav-path" class="navpath">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 <ul>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
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>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65 </div><!-- top -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 <div class="header">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 <div class="summary">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68 <a href="#nested-classes">Data Structures</a> &#124;
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 <a href="#define-members">Macros</a> &#124;
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 <a href="#func-members">Functions</a> </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 <div class="headertitle">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 <div class="title">mempool.h File Reference</div> </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 </div><!--header-->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 <div class="contents">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76 <p>Memory pool implementation.
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 <a href="#details">More...</a></p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 <div class="textblock"><code>#include &quot;<a class="el" href="ucx_8h_source.html">ucx.h</a>&quot;</code><br />
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 <code>#include &quot;<a class="el" href="allocator_8h_source.html">allocator.h</a>&quot;</code><br />
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 <code>#include &lt;stddef.h&gt;</code><br />
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 <p><a href="mempool_8h_source.html">Go to the source code of this file.</a></p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 <table class="memberdecls">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 Data Structures</h2></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structUcxMempool.html">UcxMempool</a></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">UCX mempool structure. <a href="structUcxMempool.html#details">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 </table><table class="memberdecls">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91 Macros</h2></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 <tr class="memitem:a49f7bd1da5ac201d0cf54dc0f0d82dd2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#a49f7bd1da5ac201d0cf54dc0f0d82dd2">ucx_mempool_new_default</a>()&#160;&#160;&#160;<a class="el" href="mempool_8h.html#ad71cb8c3b6fdb30360376a8b372ef22a">ucx_mempool_new</a>(16)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 <tr class="memdesc:a49f7bd1da5ac201d0cf54dc0f0d82dd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shorthand for a new default memory pool with a capacity of 16 elements. <a href="#a49f7bd1da5ac201d0cf54dc0f0d82dd2">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 <tr class="separator:a49f7bd1da5ac201d0cf54dc0f0d82dd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 </table><table class="memberdecls">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 Functions</h2></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 <tr class="memitem:ad71cb8c3b6fdb30360376a8b372ef22a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#ad71cb8c3b6fdb30360376a8b372ef22a">ucx_mempool_new</a> (size_t n)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 <tr class="memdesc:ad71cb8c3b6fdb30360376a8b372ef22a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a memory pool with the specified initial size. <a href="#ad71cb8c3b6fdb30360376a8b372ef22a">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 <tr class="separator:ad71cb8c3b6fdb30360376a8b372ef22a"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 <tr class="memitem:aaf75b5016098723a9280531ccc3a6d77"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#aaf75b5016098723a9280531ccc3a6d77">ucx_mempool_chcap</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, size_t newcap)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 <tr class="memdesc:aaf75b5016098723a9280531ccc3a6d77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes a memory pool. <a href="#aaf75b5016098723a9280531ccc3a6d77">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 <tr class="separator:aaf75b5016098723a9280531ccc3a6d77"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 <tr class="memitem:a2ae492b8f2878ccc9837ac213dced11e"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#a2ae492b8f2878ccc9837ac213dced11e">ucx_mempool_malloc</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, size_t n)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 <tr class="memdesc:a2ae492b8f2878ccc9837ac213dced11e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates pooled memory. <a href="#a2ae492b8f2878ccc9837ac213dced11e">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 <tr class="separator:a2ae492b8f2878ccc9837ac213dced11e"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 <tr class="memitem:a4b9142011824ae24f00fabe128417d69"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#a4b9142011824ae24f00fabe128417d69">ucx_mempool_calloc</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, size_t nelem, size_t elsize)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 <tr class="memdesc:a4b9142011824ae24f00fabe128417d69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a pooled memory array. <a href="#a4b9142011824ae24f00fabe128417d69">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 <tr class="separator:a4b9142011824ae24f00fabe128417d69"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 <tr class="memitem:a660ef42520ed6737c2e77aae18e3a7a4"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#a660ef42520ed6737c2e77aae18e3a7a4">ucx_mempool_realloc</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, void *ptr, size_t n)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 <tr class="memdesc:a660ef42520ed6737c2e77aae18e3a7a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reallocates pooled memory. <a href="#a660ef42520ed6737c2e77aae18e3a7a4">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 <tr class="separator:a660ef42520ed6737c2e77aae18e3a7a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 <tr class="memitem:aefa26e3015f5aefadbfc74221bd246ac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#aefa26e3015f5aefadbfc74221bd246ac">ucx_mempool_free</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, void *ptr)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 <tr class="memdesc:aefa26e3015f5aefadbfc74221bd246ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees pooled memory. <a href="#aefa26e3015f5aefadbfc74221bd246ac">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 <tr class="separator:aefa26e3015f5aefadbfc74221bd246ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 <tr class="memitem:af096378da7e9bfbed3088497cf4c15bf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#af096378da7e9bfbed3088497cf4c15bf">ucx_mempool_destroy</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 <tr class="memdesc:af096378da7e9bfbed3088497cf4c15bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a memory pool. <a href="#af096378da7e9bfbed3088497cf4c15bf">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 <tr class="separator:af096378da7e9bfbed3088497cf4c15bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 <tr class="memitem:adb788e7ec24cd7dbdea6381539c549f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#adb788e7ec24cd7dbdea6381539c549f2">ucx_mempool_set_destr</a> (void *ptr, <a class="el" href="ucx_8h.html#ad2b370c2809914c8b7fedab163c266b3">ucx_destructor</a> func)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 <tr class="memdesc:adb788e7ec24cd7dbdea6381539c549f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a destructor function for the specified memory. <a href="#adb788e7ec24cd7dbdea6381539c549f2">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
121 <tr class="separator:adb788e7ec24cd7dbdea6381539c549f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 <tr class="memitem:af47b6b7c40f8f263dc28cc9a4e77b27c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mempool_8h.html#af47b6b7c40f8f263dc28cc9a4e77b27c">ucx_mempool_reg_destr</a> (<a class="el" href="structUcxMempool.html">UcxMempool</a> *pool, void *ptr, <a class="el" href="ucx_8h.html#ad2b370c2809914c8b7fedab163c266b3">ucx_destructor</a> destr)</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 <tr class="memdesc:af47b6b7c40f8f263dc28cc9a4e77b27c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a destructor function for the specified (non-pooled) memory. <a href="#af47b6b7c40f8f263dc28cc9a4e77b27c">More...</a><br /></td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 <tr class="separator:af47b6b7c40f8f263dc28cc9a4e77b27c"><td class="memSeparator" colspan="2">&#160;</td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 <div class="textblock"><p>Memory pool implementation. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 <dl class="section author"><dt>Author</dt><dd>Mike Becker </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 <dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 Olaf Wintermann </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 </div><h2 class="groupheader">Macro Definition Documentation</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 <a id="a49f7bd1da5ac201d0cf54dc0f0d82dd2"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133 <h2 class="memtitle"><span class="permalink"><a href="#a49f7bd1da5ac201d0cf54dc0f0d82dd2">&#9670;&nbsp;</a></span>ucx_mempool_new_default</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139 <td class="memname">#define ucx_mempool_new_default</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 <td class="paramname"></td><td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 <td>&#160;&#160;&#160;<a class="el" href="mempool_8h.html#ad71cb8c3b6fdb30360376a8b372ef22a">ucx_mempool_new</a>(16)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
145 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 <p>Shorthand for a new default memory pool with a capacity of 16 elements. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
150 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
151 <h2 class="groupheader">Function Documentation</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 <a id="a4b9142011824ae24f00fabe128417d69"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153 <h2 class="memtitle"><span class="permalink"><a href="#a4b9142011824ae24f00fabe128417d69">&#9670;&nbsp;</a></span>ucx_mempool_calloc()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
154
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
155 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
156 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
159 <td class="memname">void* ucx_mempool_calloc </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168 <td class="paramname"><em>nelem</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174 <td class="paramname"><em>elsize</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
176 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
179 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
180 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
181 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
182 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
183
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
184 <p>Allocates a pooled memory array. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
185 <p>The content of the allocated memory is set to zero.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
186 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
187 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
188 <tr><td class="paramname">pool</td><td>the memory pool </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
189 <tr><td class="paramname">nelem</td><td>amount of elements to allocate </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
190 <tr><td class="paramname">elsize</td><td>amount of memory per element </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
191 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
192 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
193 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
194 <dl class="section return"><dt>Returns</dt><dd>a pointer to the allocated memory </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
195 <dl class="section see"><dt>See also</dt><dd><a class="el" href="allocator_8h.html#a2c0aba4221c1ac6801f03ed799f15b12" title="A function pointer to the allocators calloc() function. ">ucx_allocator_calloc()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
196
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
197 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
198 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
199 <a id="aaf75b5016098723a9280531ccc3a6d77"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
200 <h2 class="memtitle"><span class="permalink"><a href="#aaf75b5016098723a9280531ccc3a6d77">&#9670;&nbsp;</a></span>ucx_mempool_chcap()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
201
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
202 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
203 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
204 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
205 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
206 <td class="memname">int ucx_mempool_chcap </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
207 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
208 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
209 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
210 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
211 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
212 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
213 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
214 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
215 <td class="paramname"><em>newcap</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
216 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
217 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
218 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
219 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
220 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
221 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
222 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
223 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
224
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
225 <p>Resizes a memory pool. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
226 <p>This function will fail if the new capacity is not sufficient for the present data.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
227 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
228 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
229 <tr><td class="paramname">pool</td><td>the pool to resize </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
230 <tr><td class="paramname">newcap</td><td>the new capacity </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
231 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
232 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
233 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
234 <dl class="section return"><dt>Returns</dt><dd>zero on success or non-zero on failure </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
235
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
236 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
237 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
238 <a id="af096378da7e9bfbed3088497cf4c15bf"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
239 <h2 class="memtitle"><span class="permalink"><a href="#af096378da7e9bfbed3088497cf4c15bf">&#9670;&nbsp;</a></span>ucx_mempool_destroy()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
240
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
241 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
242 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
243 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
244 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
245 <td class="memname">void ucx_mempool_destroy </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
246 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
247 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
248 <td class="paramname"><em>pool</em></td><td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
249 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
250 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
251 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
252 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
253
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
254 <p>Destroys a memory pool. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
255 <p>For each element the destructor function (if any) is called and the element is freed.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
256 <p>Each of the registered destructor function that has no corresponding element within the pool (namely those registered by ucx_mempool_reg_destr) is called interleaving with the element destruction, but with guarantee to the order in which they were registered (FIFO order).</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
257 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
258 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
259 <tr><td class="paramname">pool</td><td>the mempool to destroy </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
260 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
261 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
262 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
263
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
264 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
265 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
266 <a id="aefa26e3015f5aefadbfc74221bd246ac"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
267 <h2 class="memtitle"><span class="permalink"><a href="#aefa26e3015f5aefadbfc74221bd246ac">&#9670;&nbsp;</a></span>ucx_mempool_free()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
268
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
269 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
270 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
271 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
272 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
273 <td class="memname">void ucx_mempool_free </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
274 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
275 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
276 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
277 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
278 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
279 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
280 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
281 <td class="paramtype">void *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
282 <td class="paramname"><em>ptr</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
283 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
284 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
285 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
286 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
287 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
288 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
289 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
290 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
291
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
292 <p>Frees pooled memory. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
293 <p>Before freeing the memory, the specified destructor function (if any) is called.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
294 <p>If you specify memory, that is not pooled by the specified memory pool, the program will terminate with a call to <code>abort()</code>.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
295 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
296 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
297 <tr><td class="paramname">pool</td><td>the memory pool </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
298 <tr><td class="paramname">ptr</td><td>a pointer to the memory that shall be freed </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
299 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
300 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
301 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
302 <dl class="section see"><dt>See also</dt><dd><a class="el" href="mempool_8h.html#adb788e7ec24cd7dbdea6381539c549f2" title="Sets a destructor function for the specified memory. ">ucx_mempool_set_destr()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
303
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
304 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
305 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
306 <a id="a2ae492b8f2878ccc9837ac213dced11e"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
307 <h2 class="memtitle"><span class="permalink"><a href="#a2ae492b8f2878ccc9837ac213dced11e">&#9670;&nbsp;</a></span>ucx_mempool_malloc()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
308
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
309 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
310 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
311 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
312 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
313 <td class="memname">void* ucx_mempool_malloc </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
314 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
315 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
316 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
317 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
318 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
319 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
320 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
321 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
322 <td class="paramname"><em>n</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
323 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
324 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
325 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
326 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
327 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
328 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
329 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
330 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
331
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
332 <p>Allocates pooled memory. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
333 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
334 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
335 <tr><td class="paramname">pool</td><td>the memory pool </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
336 <tr><td class="paramname">n</td><td>amount of memory to allocate </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
337 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
338 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
339 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
340 <dl class="section return"><dt>Returns</dt><dd>a pointer to the allocated memory </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
341 <dl class="section see"><dt>See also</dt><dd><a class="el" href="allocator_8h.html#a29f0f6a23a70db3b60635cd6dc384473" title="A function pointer to the allocators malloc() function. ">ucx_allocator_malloc()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
342
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
343 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
344 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
345 <a id="ad71cb8c3b6fdb30360376a8b372ef22a"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
346 <h2 class="memtitle"><span class="permalink"><a href="#ad71cb8c3b6fdb30360376a8b372ef22a">&#9670;&nbsp;</a></span>ucx_mempool_new()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
347
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
348 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
349 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
350 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
351 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
352 <td class="memname"><a class="el" href="structUcxMempool.html">UcxMempool</a>* ucx_mempool_new </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
353 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
354 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
355 <td class="paramname"><em>n</em></td><td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
356 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
357 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
358 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
359 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
360
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
361 <p>Creates a memory pool with the specified initial size. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
362 <p>As the created memory pool automatically grows in size by factor two when trying to allocate memory on a full pool, it is recommended that you use a power of two for the initial size.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
363 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
364 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
365 <tr><td class="paramname">n</td><td>initial pool size (should be a power of two, e.g. 16) </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
366 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
367 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
368 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
369 <dl class="section return"><dt>Returns</dt><dd>a pointer to the new memory pool </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
370 <dl class="section see"><dt>See also</dt><dd><a class="el" href="mempool_8h.html#a49f7bd1da5ac201d0cf54dc0f0d82dd2" title="Shorthand for a new default memory pool with a capacity of 16 elements. ">ucx_mempool_new_default()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
371
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
372 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
373 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
374 <a id="a660ef42520ed6737c2e77aae18e3a7a4"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
375 <h2 class="memtitle"><span class="permalink"><a href="#a660ef42520ed6737c2e77aae18e3a7a4">&#9670;&nbsp;</a></span>ucx_mempool_realloc()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
376
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
377 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
378 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
379 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
380 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
381 <td class="memname">void* ucx_mempool_realloc </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
382 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
383 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
384 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
385 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
386 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
387 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
388 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
389 <td class="paramtype">void *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
390 <td class="paramname"><em>ptr</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
391 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
392 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
393 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
394 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
395 <td class="paramtype">size_t&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
396 <td class="paramname"><em>n</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
397 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
398 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
399 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
400 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
401 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
402 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
403 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
404 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
405
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
406 <p>Reallocates pooled memory. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
407 <p>If the memory to be reallocated is not contained by the specified pool, the behavior is undefined.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
408 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
409 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
410 <tr><td class="paramname">pool</td><td>the memory pool </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
411 <tr><td class="paramname">ptr</td><td>a pointer to the memory that shall be reallocated </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
412 <tr><td class="paramname">n</td><td>the new size of the memory </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
413 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
414 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
415 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
416 <dl class="section return"><dt>Returns</dt><dd>a pointer to the new location of the memory </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
417 <dl class="section see"><dt>See also</dt><dd><a class="el" href="allocator_8h.html#a6d7cf038a806e327c5da37321d04e426" title="A function pointer to the allocators realloc() function. ">ucx_allocator_realloc()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
418
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
419 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
420 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
421 <a id="af47b6b7c40f8f263dc28cc9a4e77b27c"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
422 <h2 class="memtitle"><span class="permalink"><a href="#af47b6b7c40f8f263dc28cc9a4e77b27c">&#9670;&nbsp;</a></span>ucx_mempool_reg_destr()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
423
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
424 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
425 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
426 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
427 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
428 <td class="memname">void ucx_mempool_reg_destr </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
429 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
430 <td class="paramtype"><a class="el" href="structUcxMempool.html">UcxMempool</a> *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
431 <td class="paramname"><em>pool</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
432 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
433 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
434 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
435 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
436 <td class="paramtype">void *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
437 <td class="paramname"><em>ptr</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
438 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
439 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
440 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
441 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
442 <td class="paramtype"><a class="el" href="ucx_8h.html#ad2b370c2809914c8b7fedab163c266b3">ucx_destructor</a>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
443 <td class="paramname"><em>destr</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
444 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
445 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
446 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
447 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
448 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
449 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
450 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
451 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
452
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
453 <p>Registers a destructor function for the specified (non-pooled) memory. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
454 <p>This is useful, if you have memory that has not been allocated by a mempool, but shall be managed by a mempool.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
455 <p>This function creates an entry in the specified mempool and the memory will therefore (logically) convert to pooled memory. <b>However, this does not cause the memory to be freed automatically!</b>. If you want to use this function, make the memory pool free non-pooled memory, the specified destructor function must call <code>free()</code> by itself. But keep in mind, that you then MUST NOT use this destructor function with pooled memory (e.g. in <a class="el" href="mempool_8h.html#adb788e7ec24cd7dbdea6381539c549f2" title="Sets a destructor function for the specified memory. ">ucx_mempool_set_destr()</a>), as it would cause a double-free.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
456 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
457 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
458 <tr><td class="paramname">pool</td><td>the memory pool </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
459 <tr><td class="paramname">ptr</td><td>data the destructor is registered for </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
460 <tr><td class="paramname">destr</td><td>a pointer to the destructor function </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
461 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
462 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
463 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
464
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
465 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
466 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
467 <a id="adb788e7ec24cd7dbdea6381539c549f2"></a>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
468 <h2 class="memtitle"><span class="permalink"><a href="#adb788e7ec24cd7dbdea6381539c549f2">&#9670;&nbsp;</a></span>ucx_mempool_set_destr()</h2>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
469
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
470 <div class="memitem">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
471 <div class="memproto">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
472 <table class="memname">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
473 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
474 <td class="memname">void ucx_mempool_set_destr </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
475 <td>(</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
476 <td class="paramtype">void *&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
477 <td class="paramname"><em>ptr</em>, </td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
478 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
479 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
480 <td class="paramkey"></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
481 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
482 <td class="paramtype"><a class="el" href="ucx_8h.html#ad2b370c2809914c8b7fedab163c266b3">ucx_destructor</a>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
483 <td class="paramname"><em>func</em>&#160;</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
484 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
485 <tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
486 <td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
487 <td>)</td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
488 <td></td><td></td>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
489 </tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
490 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
491 </div><div class="memdoc">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
492
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
493 <p>Sets a destructor function for the specified memory. </p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
494 <p>The destructor is automatically called when the memory is freed or the pool is destroyed. A destructor for pooled memory <b>MUST NOT</b> free the memory itself, as this is done by the pool. Use a destructor to free any resources managed by the pooled object.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
495 <p>The only requirement for the specified memory is, that it <b>MUST</b> be pooled memory by a <a class="el" href="structUcxMempool.html" title="UCX mempool structure. ">UcxMempool</a> or an element-compatible mempool. The pointer to the destructor function is saved in a reserved area before the actual memory.</p>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
496 <dl class="params"><dt>Parameters</dt><dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
497 <table class="params">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
498 <tr><td class="paramname">ptr</td><td>pooled memory </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
499 <tr><td class="paramname">func</td><td>a pointer to the destructor function </td></tr>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
500 </table>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
501 </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
502 </dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
503 <dl class="section see"><dt>See also</dt><dd><a class="el" href="mempool_8h.html#aefa26e3015f5aefadbfc74221bd246ac" title="Frees pooled memory. ">ucx_mempool_free()</a> </dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
504 <dd>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
505 <a class="el" href="mempool_8h.html#af096378da7e9bfbed3088497cf4c15bf" title="Destroys a memory pool. ">ucx_mempool_destroy()</a> </dd></dl>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
506
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
507 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
508 </div>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
509 </div><!-- contents -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
510 <!-- start footer part -->
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
511 <hr class="footer"/><address class="footer"><small>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
512 Generated on Thu Dec 19 2019 19:58:24 for ucx by &#160;<a href="http://www.doxygen.org/index.html">
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
513 <img class="footer" src="doxygen.png" alt="doxygen"/>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
514 </a> 1.8.13
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
515 </small></address>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
516 </body>
d345541018fa starts ucx 3.0 development
Mike Becker <universe@uap-core.de>
parents:
diff changeset
517 </html>

mercurial