| Home | Libraries | People | FAQ | More

### Class stack_traits

stack_traits models a stack-traits providing a way to access certain properites defined by the enironment. Stack allocators use stack-traits to allocate stacks.

    #include <boost/context/stack_traits.hpp>

    struct stack_traits {
        static bool is_unbounded() noexcept;

        static std::size_t page_size() noexcept;

        static std::size_t default_size() noexcept;

        static std::size_t minimum_size() noexcept;

        static std::size_t maximum_size() noexcept;
    }

##### `static bool is_unbounded()`

Returns:

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

Throws:

  Nothing.

##### `static std::size_t page_size()`

Returns:

  Returns the page size in bytes.

Throws:

  Nothing.

##### `static std::size_t default_size()`

Returns:

  Returns a default stack size, which may be platform specific. If the stack is unbounded then the present implementation returns the maximum of `64 kB` and `minimum_size()`.

Throws:

  Nothing.

##### `static std::size_t minimum_size()`

Returns:

  Returns the minimum size in bytes of stack defined by the environment (Win32 4kB/Win64 8kB, defined by rlimit on POSIX).

Throws:

  Nothing.

##### `static std::size_t maximum_size()`

Preconditions:

  `is_unbounded()` returns `false`.

Returns:

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

Throws:

  Nothing.