<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/> <title>GNU Radio 3.2.2 C++ API: pmt_pool Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2 --> <div class="contents"> <h1>pmt_pool Class Reference</h1><!-- doxytag: class="pmt_pool" --> <p>very simple thread-safe fixed-size allocation pool <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="pmt__pool_8h_source.html">pmt_pool.h</a>></code></p> <p><a href="classpmt__pool-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>item</b></td></tr> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpmt__pool.html#aff4e8d57d1441a79ccd0a7b6164f7e4e">pmt_pool</a> (size_t itemsize, size_t alignment=16, size_t allocation_size=4096, size_t max_items=0)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpmt__pool.html#aee7004d923b1a2bfef46c46d8e18a0eb">~pmt_pool</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classpmt__pool.html#a92d57a2f62e3b02693b86755e42a23c2">malloc</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpmt__pool.html#a949bba8b34cfa48772eecf8926cb475b">free</a> (void *p)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>very simple thread-safe fixed-size allocation pool </p> <p>FIXME may want to go to global allocation with per-thread free list. This would eliminate virtually all lock contention. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="aff4e8d57d1441a79ccd0a7b6164f7e4e"></a><!-- doxytag: member="pmt_pool::pmt_pool" ref="aff4e8d57d1441a79ccd0a7b6164f7e4e" args="(size_t itemsize, size_t alignment=16, size_t allocation_size=4096, size_t max_items=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">pmt_pool::pmt_pool </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"> <em>itemsize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>alignment</em> = <code>16</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>allocation_size</em> = <code>4096</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>max_items</em> = <code>0</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>itemsize</em> </td><td>size in bytes of the items to be allocated. </td></tr> <tr><td valign="top"></td><td valign="top"><em>alignment</em> </td><td>alignment in bytes of all objects to be allocated (must be power-of-2). </td></tr> <tr><td valign="top"></td><td valign="top"><em>allocation_size</em> </td><td>number of bytes to allocate at a time from the underlying allocator. </td></tr> <tr><td valign="top"></td><td valign="top"><em>max_items</em> </td><td>is the maximum number of items to allocate. If this number is exceeded, the allocate blocks. 0 implies no limit. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aee7004d923b1a2bfef46c46d8e18a0eb"></a><!-- doxytag: member="pmt_pool::~pmt_pool" ref="aee7004d923b1a2bfef46c46d8e18a0eb" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">pmt_pool::~pmt_pool </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a949bba8b34cfa48772eecf8926cb475b"></a><!-- doxytag: member="pmt_pool::free" ref="a949bba8b34cfa48772eecf8926cb475b" args="(void *p)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void pmt_pool::free </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"> <em>p</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a92d57a2f62e3b02693b86755e42a23c2"></a><!-- doxytag: member="pmt_pool::malloc" ref="a92d57a2f62e3b02693b86755e42a23c2" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* pmt_pool::malloc </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="pmt__pool_8h_source.html">pmt_pool.h</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>