1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50<title>nn::fnd::UnitHeapTemplate</title> 51 </head> 52 <body> 53<h1><CODE>nn::fnd::UnitHeapTemplate</CODE> Class</h1> 54<h2>Syntax</h2> 55 <div class="section"> 56 <pre class="definition">template <class LockPolicy> 57class UnitHeapTemplate : public <a href="../../../nn/fnd/UnitHeapBase/Overview.html">nn::fnd::UnitHeapBase</a></pre> 58 </div> 59<h2>Template Arguments</h2> 60 <div class="section"> 61 <table class="arguments"> 62 <thead> 63 <tr> 64<th>Name</th> 65<td>Description</td> 66 </tr> 67 </thead> 68 <tr> 69<th>LockPolicy</th> 70<td>Specifies the lock policy to use during operations on the heap.</td> 71 </tr> </table> 72 </div> 73<h2>Description</h2> 74 <div class="section"> 75<p>Class template for the unit heap.</p><p>In classes that instantiate this class template, mutual exclusion is done using the lock policy specified by this function. For the lock policy, you can either specify one of the classes declared within the <CODE><a href="../../../nn/os/LockPolicy/Overview.html">nn::os::LockPolicy</a></CODE> class, or specify a class that instantiates the class template. Neither operation nor compatibility is guaranteed if you specify any other class for the <SPAN class="argument">LockPolicy</SPAN> argument.</p><p>Locking is only performed on operations within the heap. If you want to perform operations on the heap hierarchy, you must take additional appropriate measures to ensure exclusive access.</p><!-- write here --></div> 76 <a name="class" id="class"> 77<h2>Classes</h2> 78 <div class="section"> 79 <table class="members"> 80 <tr> 81 <th> 82<a href="../../../nn/fnd/UnitHeapTemplate/Allocator/Overview.html">nn::fnd::UnitHeapTemplate::Allocator</a> 83 </th> 84<td>Allocator class for the unit heap.</td> 85 </tr> </table> 86 </div> 87 </a> <a name="function" id="function"> 88<h2>Member Functions</h2> 89 <div class="section"> 90 <table class="members"> 91 <tr> 92 <td width="100"> 93<span class="static_style" title="static">S</span> </td> 94 <th> 95<a href="../../../nn/fnd/UnitHeapTemplate/GetRequiredHeapSize.html">GetRequiredHeapSize</a> 96 </th> 97<td>Gets the minimum size of heap memory required to manage the specified number of blocks of the specified unit size and alignment.</td> 98 </tr> 99 <tr> 100 <td width="100"> 101<span class="static_style" title="static">S</span> </td> 102 <th> 103<a href="../../../nn/fnd/UnitHeapTemplate/Create.html">Create</a> 104 </th> 105<td>Creates a unit heap within a heap.</td> 106 </tr> 107 <tr> 108 <td width="100"> </td> 109 <th> 110<a href="../../../nn/fnd/UnitHeapTemplate/UnitHeapTemplate.html">UnitHeapTemplate</a> 111 </th> 112<td>Constructor. No initialization is performed.</td> 113 </tr> 114 <tr> 115 <td width="100"> </td> 116 <th> 117<a href="../../../nn/fnd/UnitHeapTemplate/Initialize.html">Initialize</a> 118 </th> 119<td>Initializes the unit heap using the specified parameters. Used for objects that were created using the non-initializing constructor.</td> 120 </tr> 121 <tr> 122 <td width="100"> </td> 123 <th> 124<a href="../../../nn/fnd/UnitHeapTemplate/Invalidate.html">Invalidate</a> 125 </th> 126<td>Invalidates the heap object. After this function is called, no operations except <a href="../../../nn/fnd/UnitHeapTemplate/Finalize.html"><CODE>Finalize</CODE></a> can be performed on the heap.</td> 127 </tr> 128 <tr> 129 <td width="100"> </td> 130 <th> 131<a href="../../../nn/fnd/UnitHeapTemplate/Finalize.html">Finalize</a> 132 </th> 133<td>Ends a heap object. This function is implicitly called by the destructor, so you do not need to call it explicitly.</td> 134 </tr> 135 <tr> 136<td width="100"> <span class="virtual_style" title="virtual">V</span> 137 </td> 138 <th> 139<a href="../../../nn/fnd/UnitHeapTemplate/~UnitHeapTemplate.html">~UnitHeapTemplate</a> 140 </th> 141<td>Destructor.</td> 142 </tr> 143 <tr> 144 <td width="100"> </td> 145 <th> 146<a href="../../../nn/fnd/UnitHeapTemplate/Allocate.html">Allocate</a> 147 </th> 148<td>Allocates memory from the heap based on the unit.</td> 149 </tr> 150 <tr> 151 <td width="100"> </td> 152 <th> 153<a href="../../../nn/fnd/UnitHeapTemplate/Free.html">Free</a> 154 </th> 155<td>Frees memory allocated from the calling heap.</td> 156 </tr> 157 <tr> 158<td width="100"> <span class="virtual_style" title="virtual">V</span> 159 </td> 160 <th> 161<a href="../../../nn/fnd/UnitHeapTemplate/FreeV.html">FreeV</a> 162 </th> 163<td>Frees memory allocated from the calling heap.</td> 164 </tr> 165 <tr> 166 <td width="100"> </td> 167 <th> 168<a href="../../../nn/fnd/UnitHeapTemplate/GetUnitSize.html">GetUnitSize</a> 169 </th> 170<td>Gets the unit size of the calling unit heap.</td> 171 </tr> 172 <tr> 173 <td width="100"> </td> 174 <th> 175<a href="../../../nn/fnd/UnitHeapTemplate/GetAllocatableCount.html">GetAllocatableCount</a> 176 </th> 177<td>Gets the number of units that can currently be allocated from the calling heap.</td> 178 </tr> 179 <tr> 180<td width="100"> <span class="virtual_style" title="virtual">V</span> 181 </td> 182 <th> 183<a href="../../../nn/fnd/UnitHeapTemplate/GetStartAddress.html">GetStartAddress</a> 184 </th> 185<td>Gets the starting address of the unit heap's memory region.</td> 186 </tr> 187 <tr> 188<td width="100"> <span class="virtual_style" title="virtual">V</span> 189 </td> 190 <th> 191<a href="../../../nn/fnd/UnitHeapTemplate/GetTotalSize.html">GetTotalSize</a> 192 </th> 193<td>Gets the memory size allocated to the unit heap.</td> 194 </tr> 195 <tr> 196<td width="100"> <span class="virtual_style" title="virtual">V</span> 197 </td> 198 <th> 199<a href="../../../nn/fnd/UnitHeapTemplate/Dump.html">Dump</a> 200 </th> 201<td>Displays a heap's internal information. (Used for debugging.)</td> 202 </tr> 203 <tr> 204<td width="100"> <span class="virtual_style" title="virtual">V</span> 205 </td> 206 <th> 207<a href="../../../nn/fnd/UnitHeapTemplate/HasAddress.html">HasAddress</a> 208 </th> 209<td>Determines whether the specified address is located within a heap.</td> 210 </tr> </table> 211 </div> 212 </a> 213<h2>Class Hierarchy</h2> 214 <div class="section"> 215<p class="hierarchy"><span>ADLFireWall::NonCopyable</span><br /> <span>nn::fnd::IntrusiveLinkedList</span><br /> <a href="../../../nn/fnd/HeapBase/Overview.html">nn::fnd::HeapBase</a><br /> <a href="../../../nn/fnd/UnitHeapBase/Overview.html">nn::fnd::UnitHeapBase</a><br /> <b>nn::fnd::UnitHeapTemplate</b> 216 </p> 217 </div> 218<h2>Revision History</h2> 219 <div class="section"> 220 <dl class="history"> 221 <dt>2010/01/07</dt> 222<dd>Initial version.<br /> 223 </dd> 224 </dl> 225 </div> 226 <hr><p>CONFIDENTIAL</p></body> 227</html>