Boost logo

Boost Users :

Subject: Re: [Boost-users] [context] How to set stack pointer in a platform-independent way?
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2014-09-19 02:10:24


>
> But it's still not clear how to set the stack pointer portably, even after
> examining the code of Boost.Coroutine. For now, Boost.Context only supports
> downward stack, and Boost.Coroutine, which happened to be written by the
> same author, just assumes that the stack always grows downward, which is
> not really a portable implementation, if future Boost.Context
>

boost.context is implemented for specific architectures/platforms, e.g. it
does not contain generic code which will work in general.
that said - you can not have a 'portable' implementation.
an architecture/platform determines in which direction the stack grows - at
the moment all architectures/platforms supported by boost.context have
downward growing stack.

> supports upward stack, Boost.Coroutine has to be changed as well.
>

yes, if in the future an architecture/platform with upward growing stack
will be supported, the stack allocator classes have to be modified



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net