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<title>Initialize</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/os/Overview.html">os</a>::<a href="../../../nn/os/StackMemoryAutoStackManager/Overview.html">StackMemoryAutoStackManager</a>::Initialize</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14void Initialize(
15     <a href="../../../nn/fnd/IAllocator/Overview.html">fnd::IAllocator</a> * pAllocator,
16     <a href="../../../nn_types/uptr.html">uptr</a> stackBottom
17);
18
19template &lt;typename StackT&gt;
20void Initialize(
21     <a href="../../../nn/fnd/IAllocator/Overview.html">fnd::IAllocator</a> * pAllocator,
22     StackT & stack
23);
24</pre>
25    </div>
26<h2>List of Overloaded Member Functions</h2>
27    <div class="section">
28      <table class="members">
29        <tr>
30          <td>
31<a href="./Initialize(0).html"><CODE>Initialize(fnd::IAllocator *, uptr)</CODE> </a>
32          </td>
33<td>Performs initialization.</td>
34        </tr>
35        <tr>
36          <td>
37<a href="./Initialize(1).html"><CODE>Initialize(fnd::IAllocator *, StackT &)</CODE> </a>
38          </td>
39<td>Performs initialization.</td>
40        </tr> </table>
41    </div>
42<h2>Description of <CODE>Initialize(fnd::IAllocator *, uptr )</CODE></h2>
43<div class="section"><p>Specifies the allocator that will actually perform memory allocation.</p><p>The allocator specified for <SPAN class="argument">pAllocator</SPAN> must be maintained until the call to the <CODE><a href="../../../nn/os/StackMemoryAutoStackManager/Finalize.html">Finalize</a></CODE> function. Since the allocator can be accessed from multiple threads, it must be thread-safe. Further, the allocator must be able to allocate memory regions aligned to <CODE>0x1000</CODE>-byte boundaries. In the <CODE><a href="../../../nn/os/StackMemoryAutoStackManager/Construct.html">Construct</a></CODE> function, the value <CODE>0x1000</CODE> is passed to the second argument of <CODE>pAllocator-&gt;Allocate</CODE>.</p><p>When the stack is released, <SPAN class="argument">stackBottom</SPAN> is used as the stack. Within the <CODE><a href="../../../nn/os/StackMemoryAutoStackManager/Destruct.html">Destruct</a></CODE> member functions, <CODE>pAllocator-&gt;Free</CODE> is called after the stack has been replaced by <SPAN class="argument">stackBottom</SPAN>. For this reason, the size of the stack pointed to by <SPAN class="argument">stackBottom</SPAN> must match the stack size used by <CODE>pAllocator-&gt;Free</CODE>.</p><!-- write here --></div>
44<h2>Description of <CODE>Initialize(fnd::IAllocator *, StackT &)</CODE></h2>
45<div class="section"><p>Executes <CODE>Initialize(pAllocator, stack.GetStackBottom())</CODE>. For details, see <CODE><a href="../../../nn/os/StackMemoryAutoStackManager/Initialize.html">Initialize(fnd::IAllocator*, uptr)</a></CODE>.</p><p><SPAN class="argument">StackT</SPAN> requires that the <CODE>GetStackBottom</CODE> function be called to get the bottom of the stack.</p><!-- write here --></div>
46  <hr><p>CONFIDENTIAL</p></body>
47</html>
48