Boost logo

Boost :

Subject: Re: [boost] [context] Why does boost::ctx::minimum_stacksize() on Windows return 65536
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-09-02 13:55:42


Am 02.09.2012 19:32, schrieb Hartmut Kaiser:
> I don't see how that info relates to my question, sorry. Even if I
> need only 4k of stack space (or 8k, or whatever), I still would like
> to get the guard page detecting stack overruns.
My target development platform is POSIX - not Windows; maybe my
understanding of the related MSDN articles was not correct.

> But why should I be forced to do so if all I need to change is to
> remove the check for the minimal stack size. The constraint you're
> trying to enforce is something belonging into the documentation, not
> the code.
You are referring to the precondition in maximum_stacksize()? The
documentation of maximum_stacksize() contains the info that
is_stack_unbounded() returns false as precondition.

> BTW, on an unrelated note: I think the ctx::minimum_stacksize() and
> ctx::maximum_stacksize() functions should be tied to the allocator.
> They should not be global as they will return wrong numbers if a
> custom allocator is used.
good point - both functions should be part of the stack_allocator
interface. I'll change it asap.

What are the minimum and maximum stacksize on the several Windows
versions (XP, 7, 8, Ce, R, ...)? I didn't found infos in the MSDN about
this issue. Maybe pagesize? SUggestions?

Oliver


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