<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.16"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>UbixOS: include/net/mem.h File Reference</title> <link href="../../tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../jquery.js"></script> <script type="text/javascript" src="../../dynsections.js"></script> <link href="../../navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../resize.js"></script> <script type="text/javascript" src="../../navtreedata.js"></script> <script type="text/javascript" src="../../navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</script> <link href="../../doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">UbixOS  <span id="projectnumber">2.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.16 --> <script type="text/javascript" src="../../menudata.js"></script> <script type="text/javascript" src="../../menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('../../',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('d9/d9a/mem_8h.html','../../');}); /* @license-end */ </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> | <a href="#typedef-members">Typedefs</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">mem.h File Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include <<a class="el" href="../../dc/dba/opt_8h_source.html">net/opt.h</a>></code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for mem.h:</div> <div class="dyncontent"> <div class="center"><img src="../../d6/da7/mem_8h__incl.png" border="0" usemap="#include_2net_2mem_8h" alt=""/></div> <map name="include_2net_2mem_8h" id="include_2net_2mem_8h"> <area shape="rect" title=" " alt="" coords="328,5,457,32"/> <area shape="rect" href="../../dc/dba/opt_8h.html" title=" " alt="" coords="356,80,429,107"/> <area shape="rect" href="../../d2/d78/lwipopts_8h.html" title=" " alt="" coords="220,155,323,181"/> <area shape="rect" href="../../db/d16/debug_8h.html" title=" " alt="" coords="347,155,438,181"/> <area shape="rect" href="../../d2/d2d/arch_8h.html" title=" " alt="" coords="353,229,433,256"/> <area shape="rect" href="../../d0/d27/include_2sys_2types_8h.html" title=" " alt="" coords="282,453,373,480"/> <area shape="rect" href="../../dc/df0/cc_8h.html" title=" " alt="" coords="170,304,269,331"/> <area shape="rect" href="../../da/d28/kprintf_8h.html" title=" " alt="" coords="310,304,395,331"/> <area shape="rect" href="../../d3/d24/kpanic_8h.html" title=" " alt="" coords="471,304,584,331"/> <area shape="rect" href="../../d0/d6f/__types_8h.html" title=" " alt="" coords="279,677,376,704"/> <area shape="rect" href="../../d9/dab/select_8h.html" title=" " alt="" coords="281,528,374,555"/> <area shape="rect" href="../../d6/d92/cdefs_8h.html" title=" " alt="" coords="453,603,543,629"/> <area shape="rect" href="../../d6/d30/__timespec_8h.html" title=" " alt="" coords="5,603,124,629"/> <area shape="rect" href="../../df/dc5/__timeval_8h.html" title=" " alt="" coords="148,603,253,629"/> <area shape="rect" href="../../d6/da4/__sigset_8h.html" title=" " alt="" coords="277,603,377,629"/> <area shape="rect" href="../../de/df7/time_8h.html" title=" " alt="" coords="151,379,251,405"/> <area shape="rect" href="../../dc/dac/io_8h.html" title=" " alt="" coords="167,453,235,480"/> <area shape="rect" href="../../d1/d2d/stdarg_8h.html" title=" " alt="" coords="326,379,395,405"/> </map> </div> </div><div class="textblock"><div class="dynheader"> This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="../../dc/dc3/mem_8h__dep__incl.png" border="0" usemap="#include_2net_2mem_8hdep" alt=""/></div> <map name="include_2net_2mem_8hdep" id="include_2net_2mem_8hdep"> <area shape="rect" title=" " alt="" coords="1723,5,1853,32"/> <area shape="rect" href="../../d5/d70/memp__priv_8h.html" title=" " alt="" coords="1067,80,1215,121"/> <area shape="rect" href="../../d9/d9b/stats_8h.html" title=" " alt="" coords="1101,244,1230,271"/> <area shape="rect" href="../../db/d87/core_2init_8c.html" title=" " alt="" coords="127,475,228,502"/> <area shape="rect" href="../../d2/d55/tcpip_8c.html" title=" " alt="" coords="992,557,1096,584"/> <area shape="rect" href="../../d6/d49/net_2init_8c.html" title=" " alt="" coords="1741,475,1835,502"/> <area shape="rect" href="../../da/dc8/ethernetif_8c.html" title=" " alt="" coords="2404,475,2540,502"/> <area shape="rect" href="../../d3/d8f/mem_8c.html" title=" " alt="" coords="1486,319,1599,345"/> <area shape="rect" href="../../d8/df0/pbuf_8c.html" title=" " alt="" coords="399,319,507,345"/> <area shape="rect" href="../../df/d98/bot_8c.html" title=" " alt="" coords="1623,319,1718,345"/> <area shape="rect" href="../../d6/d4f/shell_8c.html" title=" " alt="" coords="1743,319,1847,345"/> <area shape="rect" href="../../d2/d96/loopif_8c.html" title=" " alt="" coords="2319,87,2433,114"/> <area shape="rect" href="../../df/dff/memp_8h.html" title=" " alt="" coords="503,169,639,196"/> <area shape="rect" href="../../d9/deb/ip6__frag_8c.html" title=" " alt="" coords="1081,475,1236,502"/> <area shape="rect" href="../../d1/d70/memp_8c.html" title=" " alt="" coords="356,557,476,584"/> <area shape="rect" href="../../d2/d2b/timeouts_8c.html" title=" " alt="" coords="549,557,683,584"/> <area shape="rect" href="../../d9/d69/netif_8h.html" title=" " alt="" coords="1026,319,1150,345"/> <area shape="rect" href="../../df/d02/netif_8c.html" title=" " alt="" coords="411,475,519,502"/> <area shape="rect" href="../../d9/d56/sys__arch_8c.html" title=" " alt="" coords="1280,319,1411,345"/> <area shape="rect" href="../../d0/d49/icmp_8h.html" title=" " alt="" coords="1180,393,1308,420"/> <area shape="rect" href="../../db/da0/icmp6_8h.html" title=" " alt="" coords="1021,393,1155,420"/> <area shape="rect" href="../../d9/d9c/igmp_8h.html" title=" " alt="" coords="309,393,437,420"/> <area shape="rect" href="../../da/d2f/ip_8h.html" title=" " alt="" coords="614,393,725,420"/> <area shape="rect" href="../../da/dc6/ip4__frag_8h.html" title=" " alt="" coords="543,475,689,502"/> <area shape="rect" href="../../d9/d74/ip6__frag_8h.html" title=" " alt="" coords="749,393,894,420"/> <area shape="rect" href="../../d7/d97/net_8h.html" title=" " alt="" coords="2023,393,2142,420"/> <area shape="rect" href="../../dd/d07/ne2k_8c.html" title=" " alt="" coords="908,632,991,659"/> <area shape="rect" href="../../d2/db6/lnc_8c.html" title=" " alt="" coords="1866,475,1937,502"/> <area shape="rect" href="../../d9/db5/tcpip_8h.html" title=" " alt="" coords="1719,393,1847,420"/> <area shape="rect" href="../../d9/d81/f_2ethernet_8h.html" title=" " alt="" coords="1541,393,1694,420"/> <area shape="rect" href="../../dd/ded/slipif_8h.html" title=" " alt="" coords="1333,393,1465,420"/> <area shape="rect" href="../../d4/d75/ubixos_2init_8h.html" title=" " alt="" coords="1931,632,2069,659"/> <area shape="rect" href="../../db/da9/include_2vfs_2vfs_8h.html" title=" " alt="" coords="2268,475,2380,502"/> <area shape="rect" href="../../d0/d29/main_8c.html" title=" " alt="" coords="1959,707,2041,733"/> <area shape="rect" href="../../d4/d27/devfs_8c.html" title=" " alt="" coords="2919,557,3028,584"/> <area shape="rect" href="../../d3/d2e/fat_8c.html" title=" " alt="" coords="3053,557,3131,584"/> <area shape="rect" href="../../d3/de7/thread_8c.html" title=" " alt="" coords="2701,632,2822,659"/> <area shape="rect" href="../../d2/d34/ubixfs_8c.html" title=" " alt="" coords="3006,632,3125,659"/> <area shape="rect" href="../../de/df2/ffs_8c.html" title=" " alt="" coords="2381,632,2462,659"/> <area shape="rect" href="../../d3/d41/ufs_8c.html" title=" " alt="" coords="2555,632,2640,659"/> <area shape="rect" href="../../d6/d13/file_8c.html" title=" " alt="" coords="1675,632,1757,659"/> <area shape="rect" href="../../d8/d2b/inode_8c.html" title=" " alt="" coords="2063,557,2161,584"/> <area shape="rect" href="../../d6/de3/namei_8c.html" title=" " alt="" coords="2185,557,2287,584"/> <area shape="rect" href="../../dd/df2/vfs_8c.html" title=" " alt="" coords="1798,632,1879,659"/> <area shape="rect" href="../../d6/d6d/buf_8h.html" title=" " alt="" coords="2361,557,2481,584"/> <area shape="rect" href="../../d9/d32/include_2ubixfs_2ubixfs_8h.html" title=" " alt="" coords="2743,557,2894,584"/> <area shape="rect" href="../../d2/d48/vitals_8h.html" title=" " alt="" coords="1737,557,1887,584"/> <area shape="rect" href="../../d0/dda/ffs_8h.html" title=" " alt="" coords="2505,557,2617,584"/> <area shape="rect" href="../../d6/d89/tcpip__priv_8h.html" title=" " alt="" coords="815,468,955,509"/> <area shape="rect" href="../../df/d7e/f_2etharp_8h.html" title=" " alt="" coords="1546,475,1689,502"/> </map> </div> </div> <p><a href="../../d9/d9a/mem_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:a2cf923436027f37ef24b3abd898120a7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a2cf923436027f37ef24b3abd898120a7">MEM_SIZE_F</a>   <a class="el" href="../../de/d8c/group__compiler__abstraction.html#gaa9d7f6eb2ee9fcc5eda3545dbb1886e0">U16_F</a></td></tr> <tr class="separator:a2cf923436027f37ef24b3abd898120a7"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:a49bff6e5dd4cb95fe6dc0670962bbf54"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a></td></tr> <tr class="separator:a49bff6e5dd4cb95fe6dc0670962bbf54"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ab0bdc525971701883f2065e7fb257a24"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#ab0bdc525971701883f2065e7fb257a24">mem_calloc</a> (<a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> count, <a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> size)</td></tr> <tr class="separator:ab0bdc525971701883f2065e7fb257a24"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2fd7aa1adf6e394d3be7c7734e7df41a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a2fd7aa1adf6e394d3be7c7734e7df41a">mem_free</a> (void *<a class="el" href="../../d0/d0f/structmem.html">mem</a>)</td></tr> <tr class="separator:a2fd7aa1adf6e394d3be7c7734e7df41a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a44a136e3b70c36abb6f8dc060c778113"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a44a136e3b70c36abb6f8dc060c778113">mem_init</a> (void)</td></tr> <tr class="separator:a44a136e3b70c36abb6f8dc060c778113"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a932aa40d85b14cb7331625e012d12335"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a932aa40d85b14cb7331625e012d12335">mem_malloc</a> (<a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> size)</td></tr> <tr class="separator:a932aa40d85b14cb7331625e012d12335"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5e39a108c44d8a72df0b30a117cb62e4"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d9a/mem_8h.html#a5e39a108c44d8a72df0b30a117cb62e4">mem_trim</a> (void *<a class="el" href="../../d0/d0f/structmem.html">mem</a>, <a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> size)</td></tr> <tr class="separator:a5e39a108c44d8a72df0b30a117cb62e4"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Heap API </p> <p class="definition">Definition in file <a class="el" href="../../d9/d9a/mem_8h_source.html">mem.h</a>.</p> </div><h2 class="groupheader">Macro Definition Documentation</h2> <a id="a2cf923436027f37ef24b3abd898120a7"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2cf923436027f37ef24b3abd898120a7">◆ </a></span>MEM_SIZE_F</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MEM_SIZE_F   <a class="el" href="../../de/d8c/group__compiler__abstraction.html#gaa9d7f6eb2ee9fcc5eda3545dbb1886e0">U16_F</a></td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="../../d9/d9a/mem_8h_source.html#l00068">68</a> of file <a class="el" href="../../d9/d9a/mem_8h_source.html">mem.h</a>.</p> </div> </div> <h2 class="groupheader">Typedef Documentation</h2> <a id="a49bff6e5dd4cb95fe6dc0670962bbf54"></a> <h2 class="memtitle"><span class="permalink"><a href="#a49bff6e5dd4cb95fe6dc0670962bbf54">◆ </a></span>mem_size_t</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> <a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a></td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="../../d9/d9a/mem_8h_source.html#l00067">67</a> of file <a class="el" href="../../d9/d9a/mem_8h_source.html">mem.h</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a id="ab0bdc525971701883f2065e7fb257a24"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab0bdc525971701883f2065e7fb257a24">◆ </a></span>mem_calloc()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* mem_calloc </td> <td>(</td> <td class="paramtype"><a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> </td> <td class="paramname"><em>count</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> </td> <td class="paramname"><em>size</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Contiguously allocates enough space for count objects that are size bytes of memory each and returns a pointer to the allocated memory.</p> <p>The allocated memory is filled with bytes of value zero.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">count</td><td>number of objects to allocate </td></tr> <tr><td class="paramname">size</td><td>size of the objects to allocate </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>pointer to allocated memory / NULL pointer if there is an error </dd></dl> <p class="definition">Definition at line <a class="el" href="../../d3/d8f/mem_8c_source.html#l00765">765</a> of file <a class="el" href="../../d3/d8f/mem_8c_source.html">mem.c</a>.</p> <p class="reference">References <a class="el" href="../../d3/d8f/mem_8c_source.html#l00603">mem_malloc()</a>, and <a class="el" href="../../da/d66/string_8h.html#ace4b911463887af5e748326323e99a23">memset()</a>.</p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="../../d9/d9a/mem_8h_ab0bdc525971701883f2065e7fb257a24_cgraph.png" border="0" usemap="#d9/d9a/mem_8h_ab0bdc525971701883f2065e7fb257a24_cgraph" alt=""/></div> <map name="d9/d9a/mem_8h_ab0bdc525971701883f2065e7fb257a24_cgraph" id="d9/d9a/mem_8h_ab0bdc525971701883f2065e7fb257a24_cgraph"> <area shape="rect" title=" " alt="" coords="5,132,97,159"/> <area shape="rect" href="../../d3/d8f/mem_8c.html#a932aa40d85b14cb7331625e012d12335" title=" " alt="" coords="145,107,241,133"/> <area shape="rect" href="../../da/d66/string_8h.html#ace4b911463887af5e748326323e99a23" title=" " alt="" coords="159,157,228,184"/> <area shape="rect" href="../../d8/d3b/group__sys__mutex.html#ga4d4eb9afe5965fa2661dd54ff55d616a" title=" " alt="" coords="289,107,407,133"/> <area shape="rect" href="../../dd/d1b/ubthread_8h.html#aa13bf141cd3e9bf0921fbf61ffc637d8" title=" " alt="" coords="455,107,601,133"/> <area shape="rect" href="../../dc/d94/armv6_2kpanic_8c.html#adb9a182aa071791a306163d50d653deb" title="print panic message and halt system" alt="" coords="649,81,709,108"/> <area shape="rect" href="../../da/d28/kprintf_8h.html#a20b56810edb62a6fe59917015c30848f" title=" " alt="" coords="651,132,708,159"/> <area shape="rect" href="../../dd/d78/video_8h.html#a5429378b96a24fadfd2d1f8d777eb95a" title=" " alt="" coords="763,81,818,108"/> <area shape="rect" href="../../df/d87/kprintf_8c.html#a3093cdac4668a4ccffdd7f77270888b7" title=" " alt="" coords="759,132,822,159"/> <area shape="rect" href="../../da/d28/kprintf_8h.html#a3b4a66bf1f6583e65660f281b6014aa1" title=" " alt="" coords="757,183,824,209"/> <area shape="rect" href="../../dc/dac/io_8h.html#a77b934268de1b3ecdcf3f275413b3108" title="input one byte from specified port" alt="" coords="876,5,957,32"/> <area shape="rect" href="../../dc/dac/io_8h.html#a8acc1a06073db2e7b92ffbd00fbd0cf1" title="outputut one byte to specified port" alt="" coords="872,56,961,83"/> <area shape="rect" href="../../dd/d71/tty_8h.html#a4f96ccac7e60296ef496008d8cbed0ff" title=" " alt="" coords="885,107,949,133"/> <area shape="rect" href="../../dd/d71/tty_8h.html#ad96f57a7c113d3cfa76ee5fed6de33c0" title=" " alt="" coords="882,157,951,184"/> <area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a71f03d2ba55111c715b6068254847a53" title=" " alt="" coords="1009,157,1084,184"/> <area shape="rect" href="../../d3/d02/armv6_2sched_8c.html#a08933fe6d593a1c78b9080359f15a0b7" title=" " alt="" coords="1133,132,1223,159"/> <area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a740766af5da58616f700fffab6768a78" title=" " alt="" coords="1132,183,1224,209"/> </map> </div> </div> </div> <a id="a2fd7aa1adf6e394d3be7c7734e7df41a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2fd7aa1adf6e394d3be7c7734e7df41a">◆ </a></span>mem_free()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mem_free </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"><em>rmem</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Put a struct mem back on the heap</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">rmem</td><td>is the data portion of a struct mem as returned by a previous call to <a class="el" href="../../d3/d8f/mem_8c.html#a932aa40d85b14cb7331625e012d12335">mem_malloc()</a> </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="../../d3/d8f/mem_8c_source.html#l00419">419</a> of file <a class="el" href="../../d3/d8f/mem_8c_source.html">mem.c</a>.</p> <p class="reference">References <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00057">LWIP_DBG_LEVEL_SERIOUS</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00083">LWIP_DBG_TRACE</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00321">LWIP_MEM_FREE_DECL_PROTECT</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00054">MEM_ALIGNMENT</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00455">MEM_DEBUG</a>, and <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>.</p> <p class="reference">Referenced by <a class="el" href="../../d2/d55/tcpip_8c_source.html#l00491">mem_free_callback()</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00715">pbuf_free()</a>.</p> </div> </div> <a id="a44a136e3b70c36abb6f8dc060c778113"></a> <h2 class="memtitle"><span class="permalink"><a href="#a44a136e3b70c36abb6f8dc060c778113">◆ </a></span>mem_init()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mem_init </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Zero the heap and initialize start, end and lowest-free </p> <p class="definition">Definition at line <a class="el" href="../../d3/d8f/mem_8c_source.html#l00382">382</a> of file <a class="el" href="../../d3/d8f/mem_8c_source.html">mem.c</a>.</p> <p class="reference">References <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00054">MEM_ALIGNMENT</a>, and <a class="el" href="../../d3/d8f/mem_8c_source.html#l00281">SIZEOF_STRUCT_MEM</a>.</p> <p class="reference">Referenced by <a class="el" href="../../db/d87/core_2init_8c_source.html#l00333">lwip_init()</a>.</p> </div> </div> <a id="a932aa40d85b14cb7331625e012d12335"></a> <h2 class="memtitle"><span class="permalink"><a href="#a932aa40d85b14cb7331625e012d12335">◆ </a></span>mem_malloc()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* mem_malloc </td> <td>(</td> <td class="paramtype"><a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> </td> <td class="paramname"><em>size</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Allocate a block of memory with a minimum of 'size' bytes.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>is the minimum size of the requested block in bytes. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>pointer to allocated memory or NULL if no free memory was found.</dd></dl> <p>Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT). </p> <p class="definition">Definition at line <a class="el" href="../../d3/d8f/mem_8c_source.html#l00603">603</a> of file <a class="el" href="../../d3/d8f/mem_8c_source.html">mem.c</a>.</p> <p class="reference">References <a class="el" href="../../d2/d2d/arch_8h_source.html#l00221">LWIP_MEM_ALIGN_SIZE</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00325">LWIP_MEM_ALLOC_DECL_PROTECT</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00282">MEM_SIZE_ALIGNED</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00280">MIN_SIZE_ALIGNED</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="../../d9/d56/sys__arch_8c_source.html#l00152">sys_mutex_lock()</a>.</p> <p class="reference">Referenced by <a class="el" href="../../da/dc8/ethernetif_8c_source.html#l00302">ethernetif_init()</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00765">mem_calloc()</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00248">pbuf_alloc()</a>.</p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="../../d9/d9a/mem_8h_a932aa40d85b14cb7331625e012d12335_cgraph.png" border="0" usemap="#d9/d9a/mem_8h_a932aa40d85b14cb7331625e012d12335_cgraph" alt=""/></div> <map name="d9/d9a/mem_8h_a932aa40d85b14cb7331625e012d12335_cgraph" id="d9/d9a/mem_8h_a932aa40d85b14cb7331625e012d12335_cgraph"> <area shape="rect" title=" " alt="" coords="5,107,101,133"/> <area shape="rect" href="../../d8/d3b/group__sys__mutex.html#ga4d4eb9afe5965fa2661dd54ff55d616a" title=" " alt="" coords="149,107,267,133"/> <area shape="rect" href="../../dd/d1b/ubthread_8h.html#aa13bf141cd3e9bf0921fbf61ffc637d8" title=" " alt="" coords="315,107,461,133"/> <area shape="rect" href="../../dc/d94/armv6_2kpanic_8c.html#adb9a182aa071791a306163d50d653deb" title="print panic message and halt system" alt="" coords="509,81,569,108"/> <area shape="rect" href="../../da/d28/kprintf_8h.html#a20b56810edb62a6fe59917015c30848f" title=" " alt="" coords="511,132,568,159"/> <area shape="rect" href="../../dd/d78/video_8h.html#a5429378b96a24fadfd2d1f8d777eb95a" title=" " alt="" coords="623,81,678,108"/> <area shape="rect" href="../../df/d87/kprintf_8c.html#a3093cdac4668a4ccffdd7f77270888b7" title=" " alt="" coords="619,132,682,159"/> <area shape="rect" href="../../da/d28/kprintf_8h.html#a3b4a66bf1f6583e65660f281b6014aa1" title=" " alt="" coords="617,183,684,209"/> <area shape="rect" href="../../dc/dac/io_8h.html#a77b934268de1b3ecdcf3f275413b3108" title="input one byte from specified port" alt="" coords="736,5,817,32"/> <area shape="rect" href="../../dc/dac/io_8h.html#a8acc1a06073db2e7b92ffbd00fbd0cf1" title="outputut one byte to specified port" alt="" coords="732,56,821,83"/> <area shape="rect" href="../../dd/d71/tty_8h.html#a4f96ccac7e60296ef496008d8cbed0ff" title=" " alt="" coords="745,107,809,133"/> <area shape="rect" href="../../dd/d71/tty_8h.html#ad96f57a7c113d3cfa76ee5fed6de33c0" title=" " alt="" coords="742,157,811,184"/> <area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a71f03d2ba55111c715b6068254847a53" title=" " alt="" coords="869,157,944,184"/> <area shape="rect" href="../../d3/d02/armv6_2sched_8c.html#a08933fe6d593a1c78b9080359f15a0b7" title=" " alt="" coords="993,132,1083,159"/> <area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a740766af5da58616f700fffab6768a78" title=" " alt="" coords="992,183,1084,209"/> </map> </div> </div> </div> <a id="a5e39a108c44d8a72df0b30a117cb62e4"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5e39a108c44d8a72df0b30a117cb62e4">◆ </a></span>mem_trim()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* mem_trim </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"><em>rmem</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="../../d9/d9a/mem_8h.html#a49bff6e5dd4cb95fe6dc0670962bbf54">mem_size_t</a> </td> <td class="paramname"><em>newsize</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Shrink memory returned by <a class="el" href="../../d3/d8f/mem_8c.html#a932aa40d85b14cb7331625e012d12335">mem_malloc()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">rmem</td><td>pointer to memory allocated by mem_malloc the is to be shrinked </td></tr> <tr><td class="paramname">newsize</td><td>required size after shrinking (needs to be smaller than or equal to the previous size) </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>for compatibility reasons: is always == rmem, at the moment or NULL if newsize is > old size, in which case rmem is NOT touched or freed! </dd></dl> <p class="definition">Definition at line <a class="el" href="../../d3/d8f/mem_8c_source.html#l00478">478</a> of file <a class="el" href="../../d3/d8f/mem_8c_source.html">mem.c</a>.</p> <p class="reference">References <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../d2/d2d/arch_8h_source.html#l00221">LWIP_MEM_ALIGN_SIZE</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00321">LWIP_MEM_FREE_DECL_PROTECT</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00282">MEM_SIZE_ALIGNED</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00280">MIN_SIZE_ALIGNED</a>, and <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>.</p> <p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00493">pbuf_realloc()</a>.</p> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_2fa1ed3146d6c2b96c5cfe4341985326.html">net</a></li><li class="navelem"><a class="el" href="../../d9/d9a/mem_8h.html">mem.h</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.16 </li> </ul> </div> </body> </html>