diff options
Diffstat (limited to 'docs/doxygen/nel/a02627.html')
-rw-r--r-- | docs/doxygen/nel/a02627.html | 1034 |
1 files changed, 1034 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02627.html b/docs/doxygen/nel/a02627.html new file mode 100644 index 00000000..3e5dfb03 --- /dev/null +++ b/docs/doxygen/nel/a02627.html @@ -0,0 +1,1034 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLMISC::CHeapMemory class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CHeapMemory Class Reference</h1><code>#include <<a class="el" href="a05782.html">heap_memory.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A Heap manager. Work with any kind of memory. This heap manager is not designed for speed (because it stills use standard heap allocation), but for use with special memory or special cases where malloc/new cannot be used. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00046">46</a> of file <a class="el" href="a05782.html">heap_memory.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya0">allocate</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya1">CHeapMemory</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLMISC_1_1CHeapMemorya1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya2">free</a> (void *ptr)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">free a block allocated with alloate(). no-op if NULL. <a class="el" href="a04199.html#a12">nlstop()</a> if don't find this block. <a href="#NLMISC_1_1CHeapMemorya2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya3">getHeapSize</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return the size passed in setHeap(). <a href="#NLMISC_1_1CHeapMemorya3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya4">getHeapSizeUsed</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return the heap size allocated. <a href="#NLMISC_1_1CHeapMemorya4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya5">initHeap</a> (void *heap, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a587">size</a>, <a class="el" href="a04558.html#a15">uint</a> align=4)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya6">reset</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">reset the entire container. NB: no <a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya2">free()</a> is made on the heap. <a href="#NLMISC_1_1CHeapMemorya6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya7">~CHeapMemory</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TAllocatedSpaceMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy0">ItAllocatedSpaceMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TEmptySpacePtrMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy1">ItEmptySpacePtrMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TEmptySpaceSizeMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy2">ItEmptySpaceSizeMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a04558.html#a7">uint8</a> *,<br> + <a class="el" href="a04558.html#a15">uint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy3">TAllocatedSpaceMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a04558.html#a7">uint8</a> *,<br> + <a class="el" href="a02628.html">CEmptySpace</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy4">TEmptySpacePtrMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::multimap< <a class="el" href="a04558.html#a15">uint</a>,<br> + <a class="el" href="a04558.html#a7">uint8</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy5">TEmptySpaceSizeMap</a></td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryd0">addEmptySpace</a> (<a class="el" href="a02628.html">CEmptySpace</a> &space)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryd1">removeEmptySpace</a> (<a class="el" href="a02628.html">CEmptySpace</a> &space)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy3">TAllocatedSpaceMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy5">TEmptySpaceSizeMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">for allocate method, the size -> empty space map. <a href="#NLMISC_1_1CHeapMemoryr2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy4">TEmptySpacePtrMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The array of empty spaces. <a href="#NLMISC_1_1CHeapMemoryr3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr4">_HeapPtr</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr5">_HeapSize</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy0" doxytag="NLMISC::CHeapMemory::ItAllocatedSpaceMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef TAllocatedSpaceMap::iterator <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy0">NLMISC::CHeapMemory::ItAllocatedSpaceMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00106">106</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00173">free()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy1" doxytag="NLMISC::CHeapMemory::ItEmptySpacePtrMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef TEmptySpacePtrMap::iterator <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy1">NLMISC::CHeapMemory::ItEmptySpacePtrMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00101">101</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00173">free()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy2" doxytag="NLMISC::CHeapMemory::ItEmptySpaceSizeMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef TEmptySpaceSizeMap::iterator <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy2">NLMISC::CHeapMemory::ItEmptySpaceSizeMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00085">85</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy3" doxytag="NLMISC::CHeapMemory::TAllocatedSpaceMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef std::map<<a class="el" href="a04558.html#a7">uint8</a>*, <a class="el" href="a04558.html#a15">uint</a>> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy3">NLMISC::CHeapMemory::TAllocatedSpaceMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00105">105</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy4" doxytag="NLMISC::CHeapMemory::TEmptySpacePtrMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef std::map<<a class="el" href="a04558.html#a7">uint8</a>*, <a class="el" href="a02628.html">CEmptySpace</a>> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy4">NLMISC::CHeapMemory::TEmptySpacePtrMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00100">100</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryy5" doxytag="NLMISC::CHeapMemory::TEmptySpaceSizeMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef std::multimap<<a class="el" href="a04558.html#a15">uint</a>, <a class="el" href="a04558.html#a7">uint8</a>*> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy5">NLMISC::CHeapMemory::TEmptySpaceSizeMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00084">84</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CHeapMemorya1" doxytag="NLMISC::CHeapMemory::CHeapMemory" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CHeapMemory::CHeapMemory </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00038">38</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00113">_Alignment</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. +<p> +<div class="fragment"><pre>00039 { +00040 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemorya6">reset</a>(); +00041 <span class="comment">// For allocate to work even if the heap is not initialized.</span> +00042 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a>= 4; +00043 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya7" doxytag="NLMISC::CHeapMemory::~CHeapMemory" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CHeapMemory::~<a class="el" href="a02627.html">CHeapMemory</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00045">45</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05781.html#l00052">reset()</a>. +<p> +<div class="fragment"><pre>00046 { +00047 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemorya6">reset</a>(); +00048 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CHeapMemoryd0" doxytag="NLMISC::CHeapMemory::addEmptySpace" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CHeapMemory::addEmptySpace </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02628.html">CEmptySpace</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>space</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00107">107</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00118">_EmptySpaceMap</a>, <a class="el" href="a05782.html#l00116">_EmptySpaces</a>, <a class="el" href="a05782.html#l00091">NLMISC::CHeapMemory::CEmptySpace::Ptr</a>, <a class="el" href="a05782.html#l00093">NLMISC::CHeapMemory::CEmptySpace::Size</a>, and <a class="el" href="a05782.html#l00095">NLMISC::CHeapMemory::CEmptySpace::SizeIt</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00173">free()</a>, and <a class="el" href="a05781.html#l00064">initHeap()</a>. +<p> +<div class="fragment"><pre>00108 { +00109 <span class="comment">// insert and get the iterator on the spaceMap.</span> +00110 space.SizeIt= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a>.insert( make_pair(space.Size, space.Ptr)); +00111 +00112 <span class="comment">// insert into the list of EmptySpaces.</span> +00113 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.insert( make_pair(space.Ptr, space) ); +00114 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya0" doxytag="NLMISC::CHeapMemory::allocate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void * NLMISC::CHeapMemory::allocate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>size</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +allocate a block of size bytes. return NULL if not enough space or if size==0. NB: for alignements consideration, allocation are aligned to 4 bytes. +<p> +Definition at line <a class="el" href="a05781.html#l00118">118</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00113">_Alignment</a>, <a class="el" href="a05782.html#l00120">_AllocatedSpaceMap</a>, <a class="el" href="a05782.html#l00118">_EmptySpaceMap</a>, <a class="el" href="a05782.html#l00116">_EmptySpaces</a>, <a class="el" href="a05782.html#l00112">_HeapSizeUsed</a>, <a class="el" href="a05781.html#l00107">addEmptySpace()</a>, <a class="el" href="a05782.html#l00085">ItEmptySpaceSizeMap</a>, <a class="el" href="a05782.html#l00091">NLMISC::CHeapMemory::CEmptySpace::Ptr</a>, <a class="el" href="a05781.html#l00096">removeEmptySpace()</a>, <a class="el" href="a05782.html#l00093">NLMISC::CHeapMemory::CEmptySpace::Size</a>, <a class="el" href="a05646.html#l00645">size</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06714.html#l00125">NL3D::CVertexBufferHeap::allocate()</a>, <a class="el" href="a05654.html#l00555">NL3D::CVertexArrayRangeATI::allocateVB()</a>, and <a class="el" href="a05654.html#l00205">NL3D::CVertexArrayRangeNVidia::allocateVB()</a>. +<p> +<div class="fragment"><pre>00119 { +00120 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a587">size</a>==0) +00121 <span class="keywordflow">return</span> NULL; +00122 +00123 <span class="comment">// Manage alignement.</span> +00124 <a class="code" href="a04223.html#a587">size</a>= (<a class="code" href="a04223.html#a587">size</a> + (<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a>-1)) & (~(<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a>-1)); +00125 +00126 +00127 <span class="comment">// retrieve the best block.</span> +00128 <span class="comment">//=========================</span> +00129 CEmptySpace bestSpace; +00130 <span class="comment">// NB: do a copy, because of removeEmptySpace() which delete the space.</span> +00131 +00132 <span class="comment">// Find the smaller space which is >= than size.</span> +00133 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryy2">ItEmptySpaceSizeMap</a> it; +00134 it= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a>.lower_bound(size); +00135 +00136 <span class="comment">// if not found, alloc fails.</span> +00137 <span class="keywordflow">if</span>(it == <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a>.end()) +00138 <span class="keywordflow">return</span> NULL; +00139 <span class="keywordflow">else</span> +00140 { +00141 <span class="comment">// NB: this space must exist in the "array".</span> +00142 bestSpace= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>[it->second]; +00143 } +00144 +00145 +00146 <span class="comment">// remove this empty space from list.</span> +00147 <span class="comment">//=========================</span> +00148 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd1">removeEmptySpace</a>(bestSpace); +00149 +00150 +00151 <span class="comment">// if any, add the space unused to the list.</span> +00152 <span class="comment">//=========================</span> +00153 <span class="keywordflow">if</span>(bestSpace.Size > <a class="code" href="a04223.html#a587">size</a>) +00154 { +00155 CEmptySpace space; +00156 space.Ptr= bestSpace.Ptr + <a class="code" href="a04223.html#a587">size</a>; +00157 space.Size= bestSpace.Size - <a class="code" href="a04223.html#a587">size</a>; +00158 +00159 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd0">addEmptySpace</a>(space); +00160 } +00161 +00162 +00163 <span class="comment">// return / insert the allocated space.</span> +00164 <span class="comment">//=========================</span> +00165 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a>.insert(make_pair(bestSpace.Ptr, size)); +00166 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a>+= <a class="code" href="a04223.html#a587">size</a>; +00167 +00168 <span class="comment">// return the ptr of start of this empty space.</span> +00169 <span class="keywordflow">return</span> bestSpace.Ptr; +00170 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya2" doxytag="NLMISC::CHeapMemory::free" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CHeapMemory::free </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void * </td> + <td class="mdname1" valign="top" nowrap> <em>ptr</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +free a block allocated with alloate(). no-op if NULL. <a class="el" href="a04199.html#a12">nlstop()</a> if don't find this block. +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00173">173</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00120">_AllocatedSpaceMap</a>, <a class="el" href="a05782.html#l00116">_EmptySpaces</a>, <a class="el" href="a05782.html#l00112">_HeapSizeUsed</a>, <a class="el" href="a05781.html#l00107">addEmptySpace()</a>, <a class="el" href="a05782.html#l00106">ItAllocatedSpaceMap</a>, <a class="el" href="a05782.html#l00101">ItEmptySpacePtrMap</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, <a class="el" href="a05782.html#l00091">NLMISC::CHeapMemory::CEmptySpace::Ptr</a>, <a class="el" href="a05781.html#l00096">removeEmptySpace()</a>, <a class="el" href="a05782.html#l00093">NLMISC::CHeapMemory::CEmptySpace::Size</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a06714.html#l00142">NL3D::CVertexBufferHeap::free()</a>, <a class="el" href="a05654.html#l00560">NL3D::CVertexArrayRangeATI::freeVB()</a>, and <a class="el" href="a05654.html#l00212">NL3D::CVertexArrayRangeNVidia::freeVB()</a>. +<p> +<div class="fragment"><pre>00174 { +00175 <span class="keywordflow">if</span>(ptr==NULL) +00176 <span class="keywordflow">return</span>; +00177 +00178 <span class="comment">// Must find the array in allocated spaces.</span> +00179 <span class="comment">//==========================</span> +00180 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryy0">ItAllocatedSpaceMap</a> itAlloc= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a>.find((<a class="code" href="a04558.html#a7">uint8</a>*)ptr); +00181 <span class="keywordflow">if</span>(itAlloc == <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a>.end()) +00182 { +00183 <a class="code" href="a04199.html#a12">nlstop</a>; +00184 <span class="keywordflow">return</span>; +00185 } +00186 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a587">size</a>= itAlloc->second; +00187 +00188 <span class="comment">// free this space from allocated Spaces.</span> +00189 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a>.erase(itAlloc); +00190 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a>-= <a class="code" href="a04223.html#a587">size</a>; +00191 +00192 +00193 <span class="comment">// Must find previous or/and next empty space, if any.</span> +00194 <span class="comment">//==========================</span> +00195 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryy1">ItEmptySpacePtrMap</a> itPrevious, itNext; +00196 +00197 <span class="comment">// find the empty space which is immediately >= than ptr.</span> +00198 itNext= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.lower_bound((<a class="code" href="a04558.html#a7">uint8</a>*)ptr); +00199 <span class="comment">// NB: it may be end(), if it is the last block (very rare).</span> +00200 +00201 <span class="comment">// some check. next empty space ptr must be after ptr.</span> +00202 <span class="keywordflow">if</span>(itNext!=<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00203 { +00204 <a class="code" href="a04199.html#a6">nlassert</a>(itNext->second.Ptr >= (<a class="code" href="a04558.html#a7">uint8</a>*)ptr + size); +00205 } +00206 +00207 <span class="comment">// if itNext is not the first empty space, there is an empty space before us.</span> +00208 <span class="keywordflow">if</span>( itNext!= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.begin() ) +00209 { +00210 <span class="comment">// NB: work even if itNext==end().</span> +00211 itPrevious= itNext; +00212 itPrevious--; +00213 <span class="comment">// some check. previous empty space ptr must be before ptr.</span> +00214 <a class="code" href="a04199.html#a6">nlassert</a>(itPrevious!=<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()); +00215 <a class="code" href="a04199.html#a6">nlassert</a>(itPrevious->second.Ptr + itPrevious->second.Size <= (<a class="code" href="a04558.html#a7">uint8</a>*)ptr ); +00216 } +00217 <span class="keywordflow">else</span> +00218 itPrevious= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end(); +00219 +00220 +00221 <span class="comment">// if next exist.</span> +00222 <span class="keywordflow">if</span>(itNext!=<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00223 { +00224 <span class="comment">// If Previous is not just after allocated ptr, it means that there is some allocated blocks beetween,</span> +00225 <span class="comment">// so it is not a valid empty space to concat.</span> +00226 <span class="keywordflow">if</span>(itNext->second.Ptr != (<a class="code" href="a04558.html#a7">uint8</a>*)ptr + <a class="code" href="a04223.html#a587">size</a>) +00227 itNext= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end(); +00228 } +00229 <span class="comment">// if previous exist.</span> +00230 <span class="keywordflow">if</span>(itPrevious!=<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00231 { +00232 <span class="comment">// If Previous is not just before allocated ptr, it means that there is some allocated blocks beetween,</span> +00233 <span class="comment">// so it is not a valid empty space to concat.</span> +00234 <span class="keywordflow">if</span>(itPrevious->second.Ptr + itPrevious->second.Size != (<a class="code" href="a04558.html#a7">uint8</a>*)ptr ) +00235 itPrevious=<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end(); +00236 } +00237 +00238 +00239 +00240 <span class="comment">// According to configuration, build the new empty space, mreging previous and next, and remove old ones.</span> +00241 <span class="comment">//==========================</span> +00242 CEmptySpace newSpace; +00243 +00244 <span class="comment">// if no previous empty space, then newSpace start at ptr.</span> +00245 <span class="keywordflow">if</span>(itPrevious == <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00246 { +00247 <span class="comment">// Start with old allocated block.</span> +00248 newSpace.Ptr= (<a class="code" href="a04558.html#a7">uint8</a>*)ptr; +00249 newSpace.Size= <a class="code" href="a04223.html#a587">size</a>; +00250 } +00251 <span class="comment">// else, start at previous Ptr.</span> +00252 <span class="keywordflow">else</span> +00253 { +00254 <span class="comment">// Start with previous block. size is previous size + allocated block size.</span> +00255 newSpace.Ptr= itPrevious->second.Ptr; +00256 newSpace.Size= itPrevious->second.Size + <a class="code" href="a04223.html#a587">size</a>; +00257 } +00258 +00259 <span class="comment">// if next empty space, must inc size.</span> +00260 <span class="keywordflow">if</span>(itNext != <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00261 { +00262 newSpace.Size+= itNext->second.Size; +00263 } +00264 +00265 +00266 <span class="comment">// remove old empty space, and add new one.</span> +00267 <span class="comment">//==========================</span> +00268 +00269 <span class="comment">// remove old empty spaces.</span> +00270 <span class="keywordflow">if</span>(itPrevious != <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00271 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd1">removeEmptySpace</a>(itPrevious->second); +00272 <span class="keywordflow">if</span>(itNext != <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.end()) +00273 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd1">removeEmptySpace</a>(itNext->second); +00274 +00275 +00276 <span class="comment">// Add the new concatenated empty space.</span> +00277 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd0">addEmptySpace</a>(newSpace); +00278 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya3" doxytag="NLMISC::CHeapMemory::getHeapSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLMISC::CHeapMemory::getHeapSize </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return the size passed in setHeap(). +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00067">67</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +References <a class="el" href="a05782.html#l00111">_HeapSize</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>00067 {<span class="keywordflow">return</span> <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr5">_HeapSize</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya4" doxytag="NLMISC::CHeapMemory::getHeapSizeUsed" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NLMISC::CHeapMemory::getHeapSizeUsed </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return the heap size allocated. +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00069">69</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +References <a class="el" href="a05782.html#l00112">_HeapSizeUsed</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>00069 {<span class="keywordflow">return</span> <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya5" doxytag="NLMISC::CHeapMemory::initHeap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CHeapMemory::initHeap </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void * </td> + <td class="mdname" nowrap> <em>heap</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>size</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>align</em> = 4</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +init the heap. this <a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya6">reset()</a> the heap. heap ptr is stored in this class, but no <a class="el" href="a02627.html">CHeapMemory</a> methods write or read into. They use standard heap instead (new / delete). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>heap</em> </td><td>the heap ptr. heap should be at least N-bytes aligned, where N is the alignment you need (see param align, 4 by default). </td></tr> + <tr><td valign=top><em>align</em> </td><td>Any size given to <a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya0">allocate()</a> will be rounded to match this alignement. Valid values are 4,8,16, or 32. 4 by default.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05781.html#l00064">64</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00113">_Alignment</a>, <a class="el" href="a05782.html#l00110">_HeapPtr</a>, <a class="el" href="a05782.html#l00111">_HeapSize</a>, <a class="el" href="a05782.html#l00112">_HeapSizeUsed</a>, <a class="el" href="a05781.html#l00107">addEmptySpace()</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, <a class="el" href="a05782.html#l00091">NLMISC::CHeapMemory::CEmptySpace::Ptr</a>, <a class="el" href="a05781.html#l00052">reset()</a>, <a class="el" href="a05782.html#l00093">NLMISC::CHeapMemory::CEmptySpace::Size</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05654.html#l00441">NL3D::CVertexArrayRangeATI::allocate()</a>, <a class="el" href="a05654.html#l00101">NL3D::CVertexArrayRangeNVidia::allocate()</a>, and <a class="el" href="a06714.html#l00056">NL3D::CVertexBufferHeap::init()</a>. +<p> +<div class="fragment"><pre>00065 { +00066 <span class="comment">// setup alignement.</span> +00067 <span class="keywordflow">if</span>(align!=4 && align!=8 && align!=16 && align!=32) +00068 { +00069 <a class="code" href="a04199.html#a12">nlstop</a>; +00070 align= 4; +00071 } +00072 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a>= align; +00073 +00074 <span class="comment">// Manage alignement.</span> +00075 <a class="code" href="a04223.html#a587">size</a>= (<a class="code" href="a04223.html#a587">size</a>) & (~(<a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr0">_Alignment</a>-1)); +00076 +00077 <span class="comment">// clear container.</span> +00078 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemorya6">reset</a>(); +00079 <span class="keywordflow">if</span>(heap==0 || <a class="code" href="a04223.html#a587">size</a>==0) +00080 <span class="keywordflow">return</span>; +00081 +00082 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr4">_HeapPtr</a>= (<a class="code" href="a04558.html#a7">uint8</a>*)heap; +00083 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr5">_HeapSize</a>= <a class="code" href="a04223.html#a587">size</a>; +00084 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a>= 0; +00085 +00086 <span class="comment">// Add the only one empty space.</span> +00087 CEmptySpace space; +00088 space.Ptr= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr4">_HeapPtr</a>; +00089 space.Size= <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr5">_HeapSize</a>; +00090 +00091 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryd0">addEmptySpace</a>(space); +00092 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryd1" doxytag="NLMISC::CHeapMemory::removeEmptySpace" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CHeapMemory::removeEmptySpace </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02628.html">CEmptySpace</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>space</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00096">96</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00118">_EmptySpaceMap</a>, <a class="el" href="a05782.html#l00116">_EmptySpaces</a>, <a class="el" href="a05782.html#l00091">NLMISC::CHeapMemory::CEmptySpace::Ptr</a>, and <a class="el" href="a05782.html#l00095">NLMISC::CHeapMemory::CEmptySpace::SizeIt</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>, and <a class="el" href="a05781.html#l00173">free()</a>. +<p> +<div class="fragment"><pre>00097 { +00098 <span class="comment">// remove the iterator on the spaceMap.</span> +00099 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a>.erase( space.SizeIt ); +00100 +00101 <span class="comment">// remove from the list of EmptySpaces. NB: must fo it after all, because "space" may be deleted.</span> +00102 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.erase( space.Ptr ); +00103 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemorya6" doxytag="NLMISC::CHeapMemory::reset" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CHeapMemory::reset </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +reset the entire container. NB: no <a class="el" href="a02627.html#NLMISC_1_1CHeapMemorya2">free()</a> is made on the heap. +<p> + +<p> +Definition at line <a class="el" href="a05781.html#l00052">52</a> of file <a class="el" href="a05781.html">heap_memory.cpp</a>. +<p> +References <a class="el" href="a05782.html#l00120">_AllocatedSpaceMap</a>, <a class="el" href="a05782.html#l00118">_EmptySpaceMap</a>, <a class="el" href="a05782.html#l00116">_EmptySpaces</a>, <a class="el" href="a05782.html#l00110">_HeapPtr</a>, <a class="el" href="a05782.html#l00111">_HeapSize</a>, and <a class="el" href="a05782.html#l00112">_HeapSizeUsed</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00038">CHeapMemory()</a>, <a class="el" href="a05654.html#l00484">NL3D::CVertexArrayRangeATI::free()</a>, <a class="el" href="a05654.html#l00144">NL3D::CVertexArrayRangeNVidia::free()</a>, <a class="el" href="a05781.html#l00064">initHeap()</a>, and <a class="el" href="a05781.html#l00045">~CHeapMemory()</a>. +<p> +<div class="fragment"><pre>00053 { +00054 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr3">_EmptySpaces</a>.clear(); +00055 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr2">_EmptySpaceMap</a>.clear(); +00056 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr1">_AllocatedSpaceMap</a>.clear(); +00057 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr4">_HeapPtr</a>= NULL; +00058 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr5">_HeapSize</a>= 0; +00059 <a class="code" href="a02627.html#NLMISC_1_1CHeapMemoryr6">_HeapSizeUsed</a>= 0; +00060 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr0" doxytag="NLMISC::CHeapMemory::_Alignment" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr0">NLMISC::CHeapMemory::_Alignment</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00113">113</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00038">CHeapMemory()</a>, and <a class="el" href="a05781.html#l00064">initHeap()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr1" doxytag="NLMISC::CHeapMemory::_AllocatedSpaceMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy3">TAllocatedSpaceMap</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr1">NLMISC::CHeapMemory::_AllocatedSpaceMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00120">120</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00173">free()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr2" doxytag="NLMISC::CHeapMemory::_EmptySpaceMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy5">TEmptySpaceSizeMap</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr2">NLMISC::CHeapMemory::_EmptySpaceMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +for allocate method, the size -> empty space map. +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00118">118</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00107">addEmptySpace()</a>, <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00096">removeEmptySpace()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr3" doxytag="NLMISC::CHeapMemory::_EmptySpaces" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryy4">TEmptySpacePtrMap</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr3">NLMISC::CHeapMemory::_EmptySpaces</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The array of empty spaces. +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00116">116</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00107">addEmptySpace()</a>, <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00173">free()</a>, <a class="el" href="a05781.html#l00096">removeEmptySpace()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr4" doxytag="NLMISC::CHeapMemory::_HeapPtr" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a>* <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr4">NLMISC::CHeapMemory::_HeapPtr</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00110">110</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00064">initHeap()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr5" doxytag="NLMISC::CHeapMemory::_HeapSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr5">NLMISC::CHeapMemory::_HeapSize</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00111">111</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05782.html#l00067">getHeapSize()</a>, <a class="el" href="a05781.html#l00064">initHeap()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CHeapMemoryr6" doxytag="NLMISC::CHeapMemory::_HeapSizeUsed" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02627.html#NLMISC_1_1CHeapMemoryr6">NLMISC::CHeapMemory::_HeapSizeUsed</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05782.html#l00112">112</a> of file <a class="el" href="a05782.html">heap_memory.h</a>. +<p> +Referenced by <a class="el" href="a05781.html#l00118">allocate()</a>, <a class="el" href="a05781.html#l00173">free()</a>, <a class="el" href="a05782.html#l00069">getHeapSizeUsed()</a>, <a class="el" href="a05781.html#l00064">initHeap()</a>, and <a class="el" href="a05781.html#l00052">reset()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05782.html">heap_memory.h</a><li><a class="el" href="a05781.html">heap_memory.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:16:53 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |