3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
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.75.2">
7 <link rel=
"home" href=
"../../../index.html" title=
"Chapter 1. Context">
8 <link rel=
"up" href=
"../stack.html" title=
"Stack allocation">
9 <link rel=
"prev" href=
"segmented.html" title=
"Class segmented">
10 <link rel=
"next" href=
"stack_context.html" title=
"Class stack_context">
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>
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>
26 <div class=
"titlepage"><div><div><h4 class=
"title">
27 <a name=
"context.econtext.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 </h4></div></div></div>
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.
32 Stack allocators use
<span class=
"emphasis"><em>stack-traits
</em></span> to allocate stacks.
34 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">context
</span><span class=
"special">/
</span><span class=
"identifier">stack_traits
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span>
36 <span class=
"keyword">struct
</span> <span class=
"identifier">stack_traits
</span>
37 <span class=
"special">{
</span>
38 <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>
40 <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>
42 <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>
44 <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>
46 <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>
47 <span class=
"special">}
</span>
50 <a name=
"context.econtext.stack.stack_traits.h0"></a>
51 <span><a name=
"context.econtext.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#context.econtext.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>
53 <div class=
"variablelist">
54 <p class=
"title"><b></b></p>
56 <dt><span class=
"term">Returns:
</span></dt>
58 Returns
<code class=
"computeroutput"><span class=
"keyword">true
</span></code> if the
59 environment defines no limit for the size of a stack.
61 <dt><span class=
"term">Throws:
</span></dt>
68 <a name=
"context.econtext.stack.stack_traits.h1"></a>
69 <span><a name=
"context.econtext.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#context.econtext.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>
71 <div class=
"variablelist">
72 <p class=
"title"><b></b></p>
74 <dt><span class=
"term">Returns:
</span></dt>
76 Returns the page size in bytes.
78 <dt><span class=
"term">Throws:
</span></dt>
85 <a name=
"context.econtext.stack.stack_traits.h2"></a>
86 <span><a name=
"context.econtext.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#context.econtext.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>
88 <div class=
"variablelist">
89 <p class=
"title"><b></b></p>
91 <dt><span class=
"term">Returns:
</span></dt>
93 Returns a default stack size, which may be platform specific. If
94 the stack is unbounded then the present implementation returns the
95 maximum of
<code class=
"computeroutput"><span class=
"number">64</span> <span class=
"identifier">kB
</span></code>
96 and
<code class=
"computeroutput"><span class=
"identifier">minimum_size
</span><span class=
"special">()
</span></code>.
98 <dt><span class=
"term">Throws:
</span></dt>
105 <a name=
"context.econtext.stack.stack_traits.h3"></a>
106 <span><a name=
"context.econtext.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#context.econtext.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>
108 <div class=
"variablelist">
109 <p class=
"title"><b></b></p>
111 <dt><span class=
"term">Returns:
</span></dt>
113 Returns the minimum size in bytes of stack defined by the environment
114 (Win32
4kB/Win64
8kB, defined by rlimit on POSIX).
116 <dt><span class=
"term">Throws:
</span></dt>
123 <a name=
"context.econtext.stack.stack_traits.h4"></a>
124 <span><a name=
"context.econtext.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#context.econtext.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>
126 <div class=
"variablelist">
127 <p class=
"title"><b></b></p>
129 <dt><span class=
"term">Preconditions:
</span></dt>
131 <code class=
"computeroutput"><span class=
"identifier">is_unbounded
</span><span class=
"special">()
</span></code>
132 returns
<code class=
"computeroutput"><span class=
"keyword">false
</span></code>.
134 <dt><span class=
"term">Returns:
</span></dt>
136 Returns the maximum size in bytes of stack defined by the environment.
138 <dt><span class=
"term">Throws:
</span></dt>
145 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
146 <td align=
"left"></td>
147 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2014 Oliver Kowalke
<p>
148 Distributed under the Boost Software License, Version
1.0. (See accompanying
149 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>)
154 <div class=
"spirit-nav">
155 <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>