]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/fiber/doc/html/fiber/stack/pooled_fixedsize.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / fiber / doc / html / fiber / stack / pooled_fixedsize.html
CommitLineData
7c673cae
FG
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4<title>Class pooled_fixedsize_stack</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Fiber">
8<link rel="up" href="../stack.html" title="Stack allocation">
9<link rel="prev" href="protected_fixedsize.html" title="Class protected_fixedsize_stack">
10<link rel="next" href="fixedsize.html" title="Class fixedsize_stack">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="protected_fixedsize.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../stack.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="fixedsize.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="fiber.stack.pooled_fixedsize"></a><a class="link" href="pooled_fixedsize.html" title="Class pooled_fixedsize_stack">Class <span class="emphasis"><em>pooled_fixedsize_stack</em></span></a>
28</h3></div></div></div>
29<p>
30 <span class="bold"><strong>Boost.Fiber</strong></span> provides the class <a class="link" href="../../"> <code class="computeroutput">pooled_fixedsize_stack</code></a> which
31 models the <a class="link" href="../stack.html#stack_allocator_concept"><span class="emphasis"><em>stack-allocator
32 concept</em></span></a>. In contrast to <a class="link" href="../../"> <code class="computeroutput">protected_fixedsize_stack</code></a> it
33 does not append a guard page at the end of each stack. The memory is managed
34 internally by <a href="http://www.boost.org/doc/libs/release/libs/pool/doc/html/boost/pool.html" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;&gt;</span></code></a>.
35 </p>
36<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fiber</span><span class="special">/</span><span class="identifier">pooled_fixedsize_stack</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
37
38<span class="keyword">struct</span> <span class="identifier">pooled_fixedsize_stack</span> <span class="special">{</span>
39 <span class="identifier">pooled_fixedsize_stack</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">stack_size</span> <span class="special">=</span> <span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">default_size</span><span class="special">(),</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">next_size</span> <span class="special">=</span> <span class="number">32</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">max_size</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
40
41 <span class="identifier">stack_context</span> <span class="identifier">allocate</span><span class="special">();</span>
42
43 <span class="keyword">void</span> <span class="identifier">deallocate</span><span class="special">(</span> <span class="identifier">stack_context</span> <span class="special">&amp;);</span>
44<span class="special">}</span>
45</pre>
46<h5>
47<a name="fiber.stack.pooled_fixedsize.h0"></a>
48 <span><a name="fiber.stack.pooled_fixedsize._code__phrase_role__identifier__pooled_fixedsize_stack__phrase__phrase_role__special_____phrase__phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__stack_size__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__next_size__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__max_size__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="pooled_fixedsize.html#fiber.stack.pooled_fixedsize._code__phrase_role__identifier__pooled_fixedsize_stack__phrase__phrase_role__special_____phrase__phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__stack_size__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__next_size__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__max_size__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">pooled_fixedsize_stack</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>
49 <span class="identifier">stack_size</span><span class="special">,</span>
50 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">next_size</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">max_size</span><span class="special">)</span></code></a>
51 </h5>
52<div class="variablelist">
53<p class="title"><b></b></p>
54<dl>
55<dt><span class="term">Preconditions:</span></dt>
56<dd><p>
57 <code class="computeroutput"><span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">is_unbounded</span><span class="special">()</span>
58 <span class="special">||</span> <span class="special">(</span>
59 <span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">maximum_size</span><span class="special">()</span>
60 <span class="special">&gt;=</span> <span class="identifier">stack_size</span><span class="special">)</span></code> and <code class="computeroutput"><span class="number">0</span>
61 <span class="special">&lt;</span> <span class="identifier">next_size</span></code>.
62 </p></dd>
63<dt><span class="term">Effects:</span></dt>
64<dd><p>
65 Allocates memory of at least <code class="computeroutput"><span class="identifier">stack_size</span></code>
66 bytes and stores a pointer to the stack and its actual size in <code class="computeroutput"><span class="identifier">sctx</span></code>. Depending on the architecture
67 (the stack grows downwards/upwards) the stored address is the highest/lowest
68 address of the stack. Argument <code class="computeroutput"><span class="identifier">next_size</span></code>
69 determines the number of stacks to request from the system the first
70 time that <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
71 needs to allocate system memory. The third argument <code class="computeroutput"><span class="identifier">max_size</span></code>
72 controls how much memory might be allocated for stacks &#8212; a value of zero
73 means no upper limit.
74 </p></dd>
75</dl>
76</div>
77<h5>
78<a name="fiber.stack.pooled_fixedsize.h1"></a>
79 <span><a name="fiber.stack.pooled_fixedsize._code__phrase_role__identifier__stack_context__phrase___phrase_role__identifier__allocate__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="pooled_fixedsize.html#fiber.stack.pooled_fixedsize._code__phrase_role__identifier__stack_context__phrase___phrase_role__identifier__allocate__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="identifier">stack_context</span> <span class="identifier">allocate</span><span class="special">()</span></code></a>
80 </h5>
81<div class="variablelist">
82<p class="title"><b></b></p>
83<dl>
84<dt><span class="term">Preconditions:</span></dt>
85<dd><p>
86 <code class="computeroutput"><span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">is_unbounded</span><span class="special">()</span>
87 <span class="special">||</span> <span class="special">(</span>
88 <span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">maximum_size</span><span class="special">()</span>
89 <span class="special">&gt;=</span> <span class="identifier">stack_size</span><span class="special">)</span></code>.
90 </p></dd>
91<dt><span class="term">Effects:</span></dt>
92<dd><p>
93 Allocates memory of at least <code class="computeroutput"><span class="identifier">stack_size</span></code>
94 bytes and stores a pointer to the stack and its actual size in <code class="computeroutput"><span class="identifier">sctx</span></code>. Depending on the architecture
95 (the stack grows downwards/upwards) the stored address is the highest/lowest
96 address of the stack.
97 </p></dd>
98</dl>
99</div>
100<h5>
101<a name="fiber.stack.pooled_fixedsize.h2"></a>
102 <span><a name="fiber.stack.pooled_fixedsize._code__phrase_role__keyword__void__phrase___phrase_role__identifier__deallocate__phrase__phrase_role__special_____phrase___phrase_role__identifier__stack_context__phrase___phrase_role__special___amp___phrase___phrase_role__identifier__sctx__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="pooled_fixedsize.html#fiber.stack.pooled_fixedsize._code__phrase_role__keyword__void__phrase___phrase_role__identifier__deallocate__phrase__phrase_role__special_____phrase___phrase_role__identifier__stack_context__phrase___phrase_role__special___amp___phrase___phrase_role__identifier__sctx__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">deallocate</span><span class="special">(</span> <span class="identifier">stack_context</span>
103 <span class="special">&amp;</span> <span class="identifier">sctx</span><span class="special">)</span></code></a>
104 </h5>
105<div class="variablelist">
106<p class="title"><b></b></p>
107<dl>
108<dt><span class="term">Preconditions:</span></dt>
109<dd><p>
110 <code class="computeroutput"><span class="identifier">sctx</span><span class="special">.</span><span class="identifier">sp</span></code> is valid, <code class="computeroutput"><span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">is_unbounded</span><span class="special">()</span> <span class="special">||</span> <span class="special">(</span> <span class="identifier">traits_type</span><span class="special">::</span><span class="identifier">maximum_size</span><span class="special">()</span> <span class="special">&gt;=</span> <span class="identifier">sctx</span><span class="special">.</span><span class="identifier">size</span><span class="special">)</span></code>.
111 </p></dd>
112<dt><span class="term">Effects:</span></dt>
113<dd><p>
114 Deallocates the stack space.
115 </p></dd>
116</dl>
117</div>
118</div>
119<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
120<td align="left"></td>
121<td align="right"><div class="copyright-footer">Copyright &#169; 2013 Oliver Kowalke<p>
122 Distributed under the Boost Software License, Version 1.0. (See accompanying
123 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
124 </p>
125</div></td>
126</tr></table>
127<hr>
128<div class="spirit-nav">
129<a accesskey="p" href="protected_fixedsize.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../stack.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="fixedsize.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
130</div>
131</body>
132</html>