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_stack">
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><h3 class=
"title">
27 <a name=
"context.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>
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.
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> <span class=
"special">{
</span>
37 <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>
39 <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>
41 <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>
43 <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>
45 <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>
46 <span class=
"special">}
</span>
49 <a name=
"context.stack.stack_traits.h0"></a>
50 <span><a name=
"context.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.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>
52 <div class=
"variablelist">
53 <p class=
"title"><b></b></p>
55 <dt><span class=
"term">Returns:
</span></dt>
57 Returns
<code class=
"computeroutput"><span class=
"keyword">true
</span></code> if the environment
58 defines no limit for the size of a stack.
60 <dt><span class=
"term">Throws:
</span></dt>
67 <a name=
"context.stack.stack_traits.h1"></a>
68 <span><a name=
"context.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.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>
70 <div class=
"variablelist">
71 <p class=
"title"><b></b></p>
73 <dt><span class=
"term">Returns:
</span></dt>
75 Returns the page size in bytes.
77 <dt><span class=
"term">Throws:
</span></dt>
84 <a name=
"context.stack.stack_traits.h2"></a>
85 <span><a name=
"context.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.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>
87 <div class=
"variablelist">
88 <p class=
"title"><b></b></p>
90 <dt><span class=
"term">Returns:
</span></dt>
92 Returns a default stack size, which may be platform specific. If the
93 stack is unbounded then the present implementation returns the maximum
94 of
<code class=
"computeroutput"><span class=
"number">64</span> <span class=
"identifier">kB
</span></code>
95 and
<code class=
"computeroutput"><span class=
"identifier">minimum_size
</span><span class=
"special">()
</span></code>.
97 <dt><span class=
"term">Throws:
</span></dt>
104 <a name=
"context.stack.stack_traits.h3"></a>
105 <span><a name=
"context.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.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>
107 <div class=
"variablelist">
108 <p class=
"title"><b></b></p>
110 <dt><span class=
"term">Returns:
</span></dt>
112 Returns the minimum size in bytes of stack defined by the environment
113 (Win32
4kB/Win64
8kB, defined by rlimit on POSIX).
115 <dt><span class=
"term">Throws:
</span></dt>
122 <a name=
"context.stack.stack_traits.h4"></a>
123 <span><a name=
"context.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.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>
125 <div class=
"variablelist">
126 <p class=
"title"><b></b></p>
128 <dt><span class=
"term">Preconditions:
</span></dt>
130 <code class=
"computeroutput"><span class=
"identifier">is_unbounded
</span><span class=
"special">()
</span></code>
131 returns
<code class=
"computeroutput"><span class=
"keyword">false
</span></code>.
133 <dt><span class=
"term">Returns:
</span></dt>
135 Returns the maximum size in bytes of stack defined by the environment.
137 <dt><span class=
"term">Throws:
</span></dt>
144 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
145 <td align=
"left"></td>
146 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2014 Oliver Kowalke
<p>
147 Distributed under the Boost Software License, Version
1.0. (See accompanying
148 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>)
153 <div class=
"spirit-nav">
154 <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>