...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Boost.Context provides easy access to the stack related limits defined by the environment.
std::size_t default_stacksize(); std::size_t minimum_stacksize(); std::size_t maximum_stacksize(); bool is_stack_unbound(); std::size_t pagesize(); std::size_t page_count( std::size_t stacksize);
std::size_t
default_stacksize()
Returns a default stack size, which may be platform specific. The present implementation returns a value of 256 kB.
std::size_t
minimum_stacksize()
Returns the minimum size in bytes of stack defined by the environment.
Nothing.
std::size_t
maximum_stacksize()
is_stack_unbound()
returns false
.
Returns the maximum size in bytes of stack defined by the environment.
Nothing.
bool is_stack_unbound()
Returns true
if the environment
defines no limit for the size of a stack.
Nothing.
std::size_t
pagesize()
Returns how many bytes the operating system allocates for one page.
Nothing.
std::size_t
page_count(
std::size_t stacksize)
Returns how many pages have to be allocated for a stack of stacksize
bytes.
Nothing.