• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Class stack_traits</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Coroutine2">
8<link rel="up" href="../stack.html" title="Stack allocation">
9<link rel="prev" href="segmented.html" title="Class segmented_stack">
10<link rel="next" href="stack_context.html" title="Class stack_context">
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="segmented.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="stack_context.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="coroutine2.stack.stack_traits"></a><a class="link" href="stack_traits.html" title="Class stack_traits">Class <span class="emphasis"><em>stack_traits</em></span></a>
28</h3></div></div></div>
29<p>
30        <span class="emphasis"><em>stack_traits</em></span> models a <span class="emphasis"><em>stack-traits</em></span>
31        providing a way to access certain properites defined by the enironment. Stack
32        allocators use <span class="emphasis"><em>stack-traits</em></span> to allocate stacks.
33      </p>
34<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">stack_traits</span>
35<span class="special">{</span>
36    <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_unbounded</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
37
38    <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">page_size</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
39
40    <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">default_size</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
41
42    <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">minimum_size</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
43
44    <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">maximum_size</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
45<span class="special">}</span>
46</pre>
47<h5>
48<a name="coroutine2.stack.stack_traits.h0"></a>
49        <span class="phrase"><a name="coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__is_unbounded__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="stack_traits.html#coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__is_unbounded__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_unbounded</span><span class="special">()</span></code></a>
50      </h5>
51<div class="variablelist">
52<p class="title"><b></b></p>
53<dl class="variablelist">
54<dt><span class="term">Returns:</span></dt>
55<dd><p>
56              Returns <code class="computeroutput"><span class="keyword">true</span></code> if the environment
57              defines no limit for the size of a stack.
58            </p></dd>
59<dt><span class="term">Throws:</span></dt>
60<dd><p>
61              Nothing.
62            </p></dd>
63</dl>
64</div>
65<h5>
66<a name="coroutine2.stack.stack_traits.h1"></a>
67        <span class="phrase"><a name="coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__page_size__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="stack_traits.html#coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__page_size__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">page_size</span><span class="special">()</span></code></a>
68      </h5>
69<div class="variablelist">
70<p class="title"><b></b></p>
71<dl class="variablelist">
72<dt><span class="term">Returns:</span></dt>
73<dd><p>
74              Returns the page size in bytes.
75            </p></dd>
76<dt><span class="term">Throws:</span></dt>
77<dd><p>
78              Nothing.
79            </p></dd>
80</dl>
81</div>
82<h5>
83<a name="coroutine2.stack.stack_traits.h2"></a>
84        <span class="phrase"><a name="coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__default_size__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="stack_traits.html#coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__default_size__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">default_size</span><span class="special">()</span></code></a>
85      </h5>
86<div class="variablelist">
87<p class="title"><b></b></p>
88<dl class="variablelist">
89<dt><span class="term">Returns:</span></dt>
90<dd><p>
91              Returns a default stack size, which may be platform specific. If the
92              stack is unbounded then the present implementation returns the maximum
93              of <code class="computeroutput"><span class="number">64</span> <span class="identifier">kB</span></code>
94              and <code class="computeroutput"><span class="identifier">minimum_size</span><span class="special">()</span></code>.
95            </p></dd>
96<dt><span class="term">Throws:</span></dt>
97<dd><p>
98              Nothing.
99            </p></dd>
100</dl>
101</div>
102<h5>
103<a name="coroutine2.stack.stack_traits.h3"></a>
104        <span class="phrase"><a name="coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__minimum_size__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="stack_traits.html#coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__minimum_size__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">minimum_size</span><span class="special">()</span></code></a>
105      </h5>
106<div class="variablelist">
107<p class="title"><b></b></p>
108<dl class="variablelist">
109<dt><span class="term">Returns:</span></dt>
110<dd><p>
111              Returns the minimum size in bytes of stack defined by the environment
112              (Win32 4kB/Win64 8kB, defined by rlimit on POSIX).
113            </p></dd>
114<dt><span class="term">Throws:</span></dt>
115<dd><p>
116              Nothing.
117            </p></dd>
118</dl>
119</div>
120<h5>
121<a name="coroutine2.stack.stack_traits.h4"></a>
122        <span class="phrase"><a name="coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__maximum_size__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="stack_traits.html#coroutine2.stack.stack_traits._code__phrase_role__keyword__static__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__maximum_size__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">maximum_size</span><span class="special">()</span></code></a>
123      </h5>
124<div class="variablelist">
125<p class="title"><b></b></p>
126<dl class="variablelist">
127<dt><span class="term">Preconditions:</span></dt>
128<dd><p>
129              <code class="computeroutput"><span class="identifier">is_unbounded</span><span class="special">()</span></code>
130              returns <code class="computeroutput"><span class="keyword">false</span></code>.
131            </p></dd>
132<dt><span class="term">Returns:</span></dt>
133<dd><p>
134              Returns the maximum size in bytes of stack defined by the environment.
135            </p></dd>
136<dt><span class="term">Throws:</span></dt>
137<dd><p>
138              Nothing.
139            </p></dd>
140</dl>
141</div>
142</div>
143<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
144<td align="left"></td>
145<td align="right"><div class="copyright-footer">Copyright © 2014 Oliver Kowalke<p>
146        Distributed under the Boost Software License, Version 1.0. (See accompanying
147        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>)
148      </p>
149</div></td>
150</tr></table>
151<hr>
152<div class="spirit-nav">
153<a accesskey="p" href="segmented.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="stack_context.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
154</div>
155</body>
156</html>
157