| Home | Libraries | People | FAQ | More

### Helper functions

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:

  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:

  Returns the minimum size in bytes of stack defined by the environment.

Throws:

  Nothing.

##### `std::size_t maximum_stacksize()`

Preconditions:

  `is_stack_unbound()` returns `false`.

Returns:

  Returns the maximum size in bytes of stack defined by the environment.

Throws:

  Nothing.

##### `bool is_stack_unbound()`

Returns:

  Returns `true` if the environment defines no limit for the size of a stack.

Throws:

  Nothing.

##### `std::size_t pagesize()`

Returns:

  Returns how many bytes the operating system allocates for one page.

Throws:

  Nothing.

##### `std::size_t page_count( std::size_t stacksize)`

Returns:

  Returns how many pages have to be allocated for a stack of `stacksize` bytes.

Throws:

  Nothing.