Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 505

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: csFixedSizeAllocator&lt; Size, Allocator &gt; Class Template Reference (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<h1>csFixedSizeAllocator&lt; Size, Allocator &gt; Class Template Reference<br>
<small>
[<a class="el" href="group__util__memory.html">Memory Management</a>]</small>
</h1><!-- doxytag: class="csFixedSizeAllocator" -->This class implements a memory allocator which can efficiently allocate objects that all have the same size.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="fixedsizeallocator_8h-source.html">csutil/fixedsizeallocator.h</a>&gt;</code>
<p>

<p>
<a href="classcsFixedSizeAllocator-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="edea983e540a0c4c20770e401525962b"></a><!-- doxytag: member="csFixedSizeAllocator::AllocatorType" ref="edea983e540a0c4c20770e401525962b" args="" -->
typedef Allocator&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#edea983e540a0c4c20770e401525962b">AllocatorType</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ff9dd8306e8da2b752f2c6df4352969"></a><!-- doxytag: member="csFixedSizeAllocator::ThisType" ref="9ff9dd8306e8da2b752f2c6df4352969" args="" -->
typedef <br>
<a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a><br>
&lt; Size, Allocator &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#9ff9dd8306e8da2b752f2c6df4352969">ThisType</a></td></tr>

<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#a23579349fa21fff8f1fa6dc30f5f427">Alloc</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a chunk of memory.  <a href="#a23579349fa21fff8f1fa6dc30f5f427"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#3492691739cb105d7274da3a5b938980">Compact</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compact the allocator so that all blocks that are completely unused are removed.  <a href="#3492691739cb105d7274da3a5b938980"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#2f59f90c657b22afe7cd4a23ec127041">csFixedSizeAllocator</a> (<a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a> const &amp;other)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct a new fixed size allocator, copying the amounts of elements to store in an allocation unit.  <a href="#2f59f90c657b22afe7cd4a23ec127041"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#8684d2f1d4b9c68d779f8b213fc89a2b">Empty</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy all chunks allocated.  <a href="#8684d2f1d4b9c68d779f8b213fc89a2b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#da2f85b56e7819fb9bd694603d85f95d">Free</a> (void *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a chunk of memory.  <a href="#da2f85b56e7819fb9bd694603d85f95d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#fbc85b60aab6f5d8f33040cb10c2cb6a">GetBlockElements</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Query number of elements per block.  <a href="#fbc85b60aab6f5d8f33040cb10c2cb6a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#8556322fce063d9f0204555fd866356b">TryFree</a> (void *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Try to delete a chunk of memory.  <a href="#8556322fce063d9f0204555fd866356b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#154d1536a1edd1837038488be2107e47">~csFixedSizeAllocator</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy all allocated objects and release memory.  <a href="#154d1536a1edd1837038488be2107e47"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Functions for useability as a allocator template parameter</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d2eb8689527b8fead5596208a308e010"></a><!-- doxytag: member="csFixedSizeAllocator::Alloc" ref="d2eb8689527b8fead5596208a308e010" args="(void *p, size_t newSize)" -->
void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#d2eb8689527b8fead5596208a308e010">Alloc</a> (void *p, size_t newSize)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fb05aa47c8f5183fc623b393c06342b1"></a><!-- doxytag: member="csFixedSizeAllocator::Alloc" ref="fb05aa47c8f5183fc623b393c06342b1" args="(size_t n)" -->
void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#fb05aa47c8f5183fc623b393c06342b1">Alloc</a> (size_t n)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4a7a649b1a90c358c950e4261e2f3ab1"></a><!-- doxytag: member="csFixedSizeAllocator::SetMemTrackerInfo" ref="4a7a649b1a90c358c950e4261e2f3ab1" args="(const char *)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#4a7a649b1a90c358c950e4261e2f3ab1">SetMemTrackerInfo</a> (const char *)</td></tr>

<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ccdb55f9c6b2ef2b0714784516151a44"></a><!-- doxytag: member="csFixedSizeAllocator::csFixedSizeAllocator" ref="ccdb55f9c6b2ef2b0714784516151a44" args="(size_t nelem, const Allocator &amp;alloc)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#ccdb55f9c6b2ef2b0714784516151a44">csFixedSizeAllocator</a> (size_t nelem, const Allocator &amp;alloc)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#f4534ee4e4e4b18b4b1fef3fd2ae8eda">csFixedSizeAllocator</a> (size_t nelem=32)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct a new fixed size allocator.  <a href="#f4534ee4e4e4b18b4b1fef3fd2ae8eda"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#6e7974ee7871949250822b3937554caa">AllocBlock</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a block and initialize its free-node chain.  <a href="#6e7974ee7871949250822b3937554caa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#cd9305bed36709e36b0d52222a4a11b8">AllocCommon</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find and allocate a block.  <a href="#cd9305bed36709e36b0d52222a4a11b8"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Disposer&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#57b6c1127a18ae1fa780c68af92a2916">DestroyObject</a> (Disposer &amp;disposer, void *p) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy an object.  <a href="#57b6c1127a18ae1fa780c68af92a2916"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Disposer&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#2d6916d415daaa8d83aeccbf922b010a">DisposeAll</a> (Disposer &amp;disposer)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys all living objects and releases all memory allocated by the pool.  <a href="#2d6916d415daaa8d83aeccbf922b010a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#e69493d266e0ed6a92fb954547b4e827">FindBlock</a> (void const *m) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find the memory block which contains the given memory.  <a href="#e69493d266e0ed6a92fb954547b4e827"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Disposer&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6">Free</a> (Disposer &amp;disposer, void *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a chunk of memory.  <a href="#69cb1c8ff50f68d5779b180bd32de2c6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#36126c87742e8fcbe2085dc404a5b166">FreeBlock</a> (<a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a> *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dispose of a block.  <a href="#36126c87742e8fcbe2085dc404a5b166"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classcsBitArray.html">csBitArray</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#fc9173862050c0e56b035ad5e5a8bf4e">GetAllocationMap</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a usage mask showing all used (1's) and free (0's) nodes in the entire allocator.  <a href="#fc9173862050c0e56b035ad5e5a8bf4e"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Disposer&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#eae28b243f7ec94c18f88cd028289b54">TryFree</a> (Disposer &amp;disposer, void *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Try to delete a chunk of memory.  <a href="#eae28b243f7ec94c18f88cd028289b54"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#25b9f1503fccb1784317f69f9e232875">FuzzyCmp</a> (<a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a> *const &amp;block, <a class="el" href="structcsFixedSizeAllocator_1_1BlockKey.html">BlockKey</a> const &amp;k)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Comparison function for <a class="el" href="classcsFixedSizeAllocator.html#e69493d266e0ed6a92fb954547b4e827" title="Find the memory block which contains the given memory.">FindBlock()</a> which does a "fuzzy" search given an arbitrary address.  <a href="#25b9f1503fccb1784317f69f9e232875"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structcsFixedSizeAllocator_1_1BlocksWrapper.html">BlocksWrapper</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#424bd61f9cd708b78284ebd8dd485eb8">blocks</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of allocated blocks; sorted by address.  <a href="#424bd61f9cd708b78284ebd8dd485eb8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#d6bf973ab1bc9ba9289be6fdec8bdf30">blocksize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Size in bytes per block.  <a href="#d6bf973ab1bc9ba9289be6fdec8bdf30"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#f205cf3779350b696deacc138890f105">elcount</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of elements per block.  <a href="#f205cf3779350b696deacc138890f105"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#0d4e723ccc2429a5378254db493ab465">elsize</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Element size; &gt;= sizeof(void*).  <a href="#0d4e723ccc2429a5378254db493ab465"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structcsFixedSizeAllocator_1_1FreeNode.html">FreeNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#5f88bf9a4e898072c43525f0580b30c8">freenode</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Head of the chain of free nodes.  <a href="#5f88bf9a4e898072c43525f0580b30c8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator.html#59d708c29be72cbbd957aff63c3ba884">insideDisposeAll</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag to ignore calls to <a class="el" href="classcsFixedSizeAllocator.html#3492691739cb105d7274da3a5b938980" title="Compact the allocator so that all blocks that are completely unused are removed.">Compact()</a> and <a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6" title="Deallocate a chunk of memory.">Free()</a> if they're called recursively while disposing the entire allocation set.  <a href="#59d708c29be72cbbd957aff63c3ba884"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcsFixedSizeAllocator_1_1BlockKey.html">BlockKey</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcsFixedSizeAllocator_1_1BlocksWrapper.html">BlocksWrapper</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsFixedSizeAllocator_1_1DefaultDisposer.html">DefaultDisposer</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default disposer mixin, just reporting leaks.  <a href="classcsFixedSizeAllocator_1_1DefaultDisposer.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcsFixedSizeAllocator_1_1FreeNode.html">FreeNode</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt;<br>
 class csFixedSizeAllocator&lt; Size, Allocator &gt;</h3>

This class implements a memory allocator which can efficiently allocate objects that all have the same size. 
<p>
It has no memory overhead per allocation (unless the objects are smaller than sizeof(void*) bytes) and is extremely fast, both for <a class="el" href="classcsFixedSizeAllocator.html#a23579349fa21fff8f1fa6dc30f5f427" title="Allocate a chunk of memory.">Alloc()</a> and <a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6" title="Deallocate a chunk of memory.">Free()</a>. The only restriction is that any specific allocator can be used for just one type of object (the type for which the template is instantiated).<p>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Defining the macro CS_FIXEDSIZEALLOC_DEBUG will cause freed objects to be overwritten with '0xfb' bytes. This can be useful to track use of already freed objects, as they can be more easily recognized (as some members will be likely bogus.) </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classcsArray.html" title="A templated array class.">csArray</a> <p>
<a class="el" href="classcsMemoryPool.html" title="A quick-allocation pool for storage of arbitrary data.">csMemoryPool</a> </dd></dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00060">60</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="f4534ee4e4e4b18b4b1fef3fd2ae8eda"></a><!-- doxytag: member="csFixedSizeAllocator::csFixedSizeAllocator" ref="f4534ee4e4e4b18b4b1fef3fd2ae8eda" args="(size_t nelem=32)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>           </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nelem</em> = <code>32</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct a new fixed size allocator. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>nelem</em>&nbsp;</td><td>Number of elements to store in each allocation unit. </td></tr>
  </table>
</dl>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Bigger values for <code>nelem</code> will improve allocation performance, but at the cost of having some potential waste if you do not add <code>nelem</code> elements to each pool. For instance, if <code>nelem</code> is 50 but you only add 3 elements to the pool, then the space for the remaining 47 elements, though allocated, will remain unused (until you add more elements). </dd></dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00319">319</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="2f59f90c657b22afe7cd4a23ec127041"></a><!-- doxytag: member="csFixedSizeAllocator::csFixedSizeAllocator" ref="2f59f90c657b22afe7cd4a23ec127041" args="(csFixedSizeAllocator const &amp;other)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt; const &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct a new fixed size allocator, copying the amounts of elements to store in an allocation unit. 
<p>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Copy-constructing an allocator is only valid if the allocator copied from is not empty. Attempting to copy a non-empty allocator will cause an assertion to fail at runtime! </dd></dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00348">348</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="154d1536a1edd1837038488be2107e47"></a><!-- doxytag: member="csFixedSizeAllocator::~csFixedSizeAllocator" ref="154d1536a1edd1837038488be2107e47" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::~<a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy all allocated objects and release memory. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00359">359</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a23579349fa21fff8f1fa6dc30f5f427"></a><!-- doxytag: member="csFixedSizeAllocator::Alloc" ref="a23579349fa21fff8f1fa6dc30f5f427" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::Alloc           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allocate a chunk of memory. 
<p>

<p>Reimplemented in <a class="el" href="classcsBlockAllocator.html#2fda57e30eb28fd3cec4ac33322e0daa">csBlockAllocator&lt; T, Allocator, ObjectDispose &gt;</a>, <a class="el" href="classcsBlockAllocator.html#2fda57e30eb28fd3cec4ac33322e0daa">csBlockAllocator&lt; csGLFontCache::GLGlyphCacheData &gt;</a>, <a class="el" href="classcsBlockAllocator.html#2fda57e30eb28fd3cec4ac33322e0daa">csBlockAllocator&lt; csFontCache::LRUEntry &gt;</a>, <a class="el" href="classcsBlockAllocator.html#2fda57e30eb28fd3cec4ac33322e0daa">csBlockAllocator&lt; csShaderVarBlockAlloc::BlockAllocatedSV, CS::Memory::AllocatorMalloc, ObjectDispose &gt;</a>, and <a class="el" href="classcsBlockAllocator.html#2fda57e30eb28fd3cec4ac33322e0daa">csBlockAllocator&lt; Node, CS::Memory::AllocatorAlign&lt; 2 &gt; &gt;</a>.</p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00424">424</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00454">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Alloc()</a>.</p>

</div>
</div><p>
<a class="anchor" name="6e7974ee7871949250822b3937554caa"></a><!-- doxytag: member="csFixedSizeAllocator::AllocBlock" ref="6e7974ee7871949250822b3937554caa" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a>* <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::AllocBlock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allocate a block and initialize its free-node chain. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The returned address is both the reference to the overall block, and the address of the first free node in the chain. </dd></dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00128">128</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00283">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocCommon()</a>.</p>

</div>
</div><p>
<a class="anchor" name="cd9305bed36709e36b0d52222a4a11b8"></a><!-- doxytag: member="csFixedSizeAllocator::AllocCommon" ref="cd9305bed36709e36b0d52222a4a11b8" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::AllocCommon           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Find and allocate a block. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00283">283</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00424">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Alloc()</a>.</p>

</div>
</div><p>
<a class="anchor" name="3492691739cb105d7274da3a5b938980"></a><!-- doxytag: member="csFixedSizeAllocator::Compact" ref="3492691739cb105d7274da3a5b938980" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::Compact           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compact the allocator so that all blocks that are completely unused are removed. 
<p>
The blocks that still contain elements are not touched. 
<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00380">380</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="57b6c1127a18ae1fa780c68af92a2916"></a><!-- doxytag: member="csFixedSizeAllocator::DestroyObject" ref="57b6c1127a18ae1fa780c68af92a2916" args="(Disposer &amp;disposer, void *p) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
<div class="memtemplate">
template&lt;typename Disposer&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::DestroyObject           </td>
          <td>(</td>
          <td class="paramtype">Disposer &amp;&nbsp;</td>
          <td class="paramname"> <em>disposer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>p</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const<code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy an object. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00157">157</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00251">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Free()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00269">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::TryFree()</a>.</p>

</div>
</div><p>
<a class="anchor" name="2d6916d415daaa8d83aeccbf922b010a"></a><!-- doxytag: member="csFixedSizeAllocator::DisposeAll" ref="2d6916d415daaa8d83aeccbf922b010a" args="(Disposer &amp;disposer)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
<div class="memtemplate">
template&lt;typename Disposer&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::DisposeAll           </td>
          <td>(</td>
          <td class="paramtype">Disposer &amp;&nbsp;</td>
          <td class="paramname"> <em>disposer</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroys all living objects and releases all memory allocated by the pool. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>disposer</em>&nbsp;</td><td>Object with a Dispose(void* p) method which is called prior to freeing the actual memory. </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00228">228</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00370">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Empty()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00359">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::~csFixedSizeAllocator()</a>.</p>

</div>
</div><p>
<a class="anchor" name="8684d2f1d4b9c68d779f8b213fc89a2b"></a><!-- doxytag: member="csFixedSizeAllocator::Empty" ref="8684d2f1d4b9c68d779f8b213fc89a2b" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::Empty           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy all chunks allocated. 
<p>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>All pointers returned by <a class="el" href="classcsFixedSizeAllocator.html#a23579349fa21fff8f1fa6dc30f5f427" title="Allocate a chunk of memory.">Alloc()</a> are invalidated. It is safe to perform new allocations from the pool after invoking <a class="el" href="classcsFixedSizeAllocator.html#8684d2f1d4b9c68d779f8b213fc89a2b" title="Destroy all chunks allocated.">Empty()</a>. </dd></dl>

<p>Reimplemented in <a class="el" href="classcsBlockAllocator.html#799b3de443ebd5b4fc807c08dc64404d">csBlockAllocator&lt; T, Allocator, ObjectDispose &gt;</a>, <a class="el" href="classcsBlockAllocator.html#799b3de443ebd5b4fc807c08dc64404d">csBlockAllocator&lt; csGLFontCache::GLGlyphCacheData &gt;</a>, <a class="el" href="classcsBlockAllocator.html#799b3de443ebd5b4fc807c08dc64404d">csBlockAllocator&lt; csFontCache::LRUEntry &gt;</a>, <a class="el" href="classcsBlockAllocator.html#799b3de443ebd5b4fc807c08dc64404d">csBlockAllocator&lt; csShaderVarBlockAlloc::BlockAllocatedSV, CS::Memory::AllocatorMalloc, ObjectDispose &gt;</a>, and <a class="el" href="classcsBlockAllocator.html#799b3de443ebd5b4fc807c08dc64404d">csBlockAllocator&lt; Node, CS::Memory::AllocatorAlign&lt; 2 &gt; &gt;</a>.</p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00370">370</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="e69493d266e0ed6a92fb954547b4e827"></a><!-- doxytag: member="csFixedSizeAllocator::FindBlock" ref="e69493d266e0ed6a92fb954547b4e827" args="(void const *m) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::FindBlock           </td>
          <td>(</td>
          <td class="paramtype">void const *&nbsp;</td>
          <td class="paramname"> <em>m</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Find the memory block which contains the given memory. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00117">117</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00251">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Free()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00169">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetAllocationMap()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00269">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::TryFree()</a>.</p>

</div>
</div><p>
<a class="anchor" name="da2f85b56e7819fb9bd694603d85f95d"></a><!-- doxytag: member="csFixedSizeAllocator::Free" ref="da2f85b56e7819fb9bd694603d85f95d" args="(void *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::Free           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>p</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Deallocate a chunk of memory. 
<p>
It is safe to provide a null pointer. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>Pointer to deallocate. </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00433">433</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="69cb1c8ff50f68d5779b180bd32de2c6"></a><!-- doxytag: member="csFixedSizeAllocator::Free" ref="69cb1c8ff50f68d5779b180bd32de2c6" args="(Disposer &amp;disposer, void *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
<div class="memtemplate">
template&lt;typename Disposer&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::Free           </td>
          <td>(</td>
          <td class="paramtype">Disposer &amp;&nbsp;</td>
          <td class="paramname"> <em>disposer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>p</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Deallocate a chunk of memory. 
<p>
It is safe to provide a null pointer. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>disposer</em>&nbsp;</td><td>Disposer object that is passed to <a class="el" href="classcsFixedSizeAllocator.html#57b6c1127a18ae1fa780c68af92a2916" title="Destroy an object.">DestroyObject()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>Pointer to deallocate. </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00251">251</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00433">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Free()</a>.</p>

</div>
</div><p>
<a class="anchor" name="36126c87742e8fcbe2085dc404a5b166"></a><!-- doxytag: member="csFixedSizeAllocator::FreeBlock" ref="36126c87742e8fcbe2085dc404a5b166" args="(uint8 *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::FreeBlock           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a> *&nbsp;</td>
          <td class="paramname"> <em>p</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Dispose of a block. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00148">148</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>.</p>

</div>
</div><p>
<a class="anchor" name="25b9f1503fccb1784317f69f9e232875"></a><!-- doxytag: member="csFixedSizeAllocator::FuzzyCmp" ref="25b9f1503fccb1784317f69f9e232875" args="(uint8 *const &amp;block, BlockKey const &amp;k)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static int <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::FuzzyCmp           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__util.html#gdde6aaee8457bee49c2a92621fe22b79">uint8</a> *const &amp;&nbsp;</td>
          <td class="paramname"> <em>block</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsFixedSizeAllocator_1_1BlockKey.html">BlockKey</a> const &amp;&nbsp;</td>
          <td class="paramname"> <em>k</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline, static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Comparison function for <a class="el" href="classcsFixedSizeAllocator.html#e69493d266e0ed6a92fb954547b4e827" title="Find the memory block which contains the given memory.">FindBlock()</a> which does a "fuzzy" search given an arbitrary address. 
<p>
It checks if the address falls somewhere within a block rather than checking if the address exactly matches the start of the block (which is the only information recorded in blocks[] array). 
<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00109">109</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00117">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::FindBlock()</a>.</p>

</div>
</div><p>
<a class="anchor" name="fc9173862050c0e56b035ad5e5a8bf4e"></a><!-- doxytag: member="csFixedSizeAllocator::GetAllocationMap" ref="fc9173862050c0e56b035ad5e5a8bf4e" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcsBitArray.html">csBitArray</a> <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::GetAllocationMap           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a usage mask showing all used (1's) and free (0's) nodes in the entire allocator. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00169">169</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>.</p>

</div>
</div><p>
<a class="anchor" name="fbc85b60aab6f5d8f33040cb10c2cb6a"></a><!-- doxytag: member="csFixedSizeAllocator::GetBlockElements" ref="fbc85b60aab6f5d8f33040cb10c2cb6a" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::GetBlockElements           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Query number of elements per block. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00450">450</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="8556322fce063d9f0204555fd866356b"></a><!-- doxytag: member="csFixedSizeAllocator::TryFree" ref="8556322fce063d9f0204555fd866356b" args="(void *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::TryFree           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>p</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Try to delete a chunk of memory. 
<p>
Usage is the same as <a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6" title="Deallocate a chunk of memory.">Free()</a>, the difference being that <code>false</code> is returned if the deallocation failed (the reason is most likely that the memory was not allocated by the allocator). 
<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00444">444</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="eae28b243f7ec94c18f88cd028289b54"></a><!-- doxytag: member="csFixedSizeAllocator::TryFree" ref="eae28b243f7ec94c18f88cd028289b54" args="(Disposer &amp;disposer, void *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
<div class="memtemplate">
template&lt;typename Disposer&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::TryFree           </td>
          <td>(</td>
          <td class="paramtype">Disposer &amp;&nbsp;</td>
          <td class="paramname"> <em>disposer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>p</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Try to delete a chunk of memory. 
<p>
Usage is the same as <a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6" title="Deallocate a chunk of memory.">Free()</a>, the difference being that <code>false</code> is returned if the deallocation failed (the reason is most likely that the memory was not allocated by the allocator). 
<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00269">269</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00444">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::TryFree()</a>.</p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="424bd61f9cd708b78284ebd8dd485eb8"></a><!-- doxytag: member="csFixedSizeAllocator::blocks" ref="424bd61f9cd708b78284ebd8dd485eb8" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcsFixedSizeAllocator_1_1BlocksWrapper.html">BlocksWrapper</a> <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#424bd61f9cd708b78284ebd8dd485eb8">blocks</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of allocated blocks; sorted by address. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00087">87</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00128">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocBlock()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00283">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocCommon()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00319">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::csFixedSizeAllocator()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00117">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::FindBlock()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00148">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::FreeBlock()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00169">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetAllocationMap()</a>.</p>

</div>
</div><p>
<a class="anchor" name="d6bf973ab1bc9ba9289be6fdec8bdf30"></a><!-- doxytag: member="csFixedSizeAllocator::blocksize" ref="d6bf973ab1bc9ba9289be6fdec8bdf30" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#d6bf973ab1bc9ba9289be6fdec8bdf30">blocksize</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Size in bytes per block. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00093">93</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00128">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocBlock()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00319">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::csFixedSizeAllocator()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00117">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::FindBlock()</a>.</p>

</div>
</div><p>
<a class="anchor" name="f205cf3779350b696deacc138890f105"></a><!-- doxytag: member="csFixedSizeAllocator::elcount" ref="f205cf3779350b696deacc138890f105" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#f205cf3779350b696deacc138890f105">elcount</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Number of elements per block. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00089">89</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00128">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocBlock()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00319">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::csFixedSizeAllocator()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00169">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetAllocationMap()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00450">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetBlockElements()</a>.</p>

</div>
</div><p>
<a class="anchor" name="0d4e723ccc2429a5378254db493ab465"></a><!-- doxytag: member="csFixedSizeAllocator::elsize" ref="0d4e723ccc2429a5378254db493ab465" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#0d4e723ccc2429a5378254db493ab465">elsize</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Element size; &gt;= sizeof(void*). 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00091">91</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00128">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocBlock()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00283">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocCommon()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00319">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::csFixedSizeAllocator()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00157">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DestroyObject()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00169">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetAllocationMap()</a>.</p>

</div>
</div><p>
<a class="anchor" name="5f88bf9a4e898072c43525f0580b30c8"></a><!-- doxytag: member="csFixedSizeAllocator::freenode" ref="5f88bf9a4e898072c43525f0580b30c8" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcsFixedSizeAllocator_1_1FreeNode.html">FreeNode</a>* <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#5f88bf9a4e898072c43525f0580b30c8">freenode</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Head of the chain of free nodes. 
<p>

<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00095">95</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00283">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocCommon()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00348">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::csFixedSizeAllocator()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00251">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Free()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00169">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::GetAllocationMap()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00269">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::TryFree()</a>.</p>

</div>
</div><p>
<a class="anchor" name="59d708c29be72cbbd957aff63c3ba884"></a><!-- doxytag: member="csFixedSizeAllocator::insideDisposeAll" ref="59d708c29be72cbbd957aff63c3ba884" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t Size, class Allocator = CS::Memory::AllocatorMalloc&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classcsFixedSizeAllocator.html">csFixedSizeAllocator</a>&lt; Size, Allocator &gt;::<a class="el" href="classcsFixedSizeAllocator.html#59d708c29be72cbbd957aff63c3ba884">insideDisposeAll</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Flag to ignore calls to <a class="el" href="classcsFixedSizeAllocator.html#3492691739cb105d7274da3a5b938980" title="Compact the allocator so that all blocks that are completely unused are removed.">Compact()</a> and <a class="el" href="classcsFixedSizeAllocator.html#69cb1c8ff50f68d5779b180bd32de2c6" title="Deallocate a chunk of memory.">Free()</a> if they're called recursively while disposing the entire allocation set. 
<p>
Recursive calls to <a class="el" href="classcsFixedSizeAllocator.html#a23579349fa21fff8f1fa6dc30f5f427" title="Allocate a chunk of memory.">Alloc()</a> will signal an assertion failure. 
<p>Definition at line <a class="el" href="fixedsizeallocator_8h-source.html#l00101">101</a> of file <a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a>.</p>

<p>Referenced by <a class="el" href="fixedsizeallocator_8h-source.html#l00283">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::AllocCommon()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00380">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Compact()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00228">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::DisposeAll()</a>, <a class="el" href="fixedsizeallocator_8h-source.html#l00251">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::Free()</a>, and <a class="el" href="fixedsizeallocator_8h-source.html#l00269">csFixedSizeAllocator&lt; sizeof(T), Allocator &gt;::TryFree()</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>csutil/<a class="el" href="fixedsizeallocator_8h-source.html">fixedsizeallocator.h</a></ul>
<hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>