Boost logo

Boost :

Subject: Re: [boost] [context] Windows ctx::maximum_stacksize() runtime asserts
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2012-09-02 09:45:52


> > The Windows implementation of boost::ctx::maximum_stacksize() does
> > always
> > assert:
> >
> > std::size_t maximum_stacksize()
> > {
> > BOOST_ASSERT( ! is_stack_unbound() );
> > static std::size_t stacksize = 8 * 1024 * 1024;
> > return stacksize;
> > }
>
> the assert statement is a pre-condition of maximum_stacksize().
> is_stack_unbound() returns true if the stack is not limited.
> calling maximum_stacksize() is only allowed if is_stack_unbound() returns
> false.
> this is a issue required by posix getrlimit() - the max stacksize to a
> certain value or unlimited (== RLIM_INFINITY).

Ok. The code does not make any sense to me anyways as on Windows this will
_always_ assert. Why try to return a sensible number is this case at all?

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk