Boost logo

Boost Users :

Subject: Re: [Boost-users] [context] How to set stack pointer in a platform-independent way?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2014-09-19 10:03:18


On 09/18/2014 10:02 PM, TONGARI J wrote:
> Hi,
>
> The problem had been discussed here:
> https://groups.google.com/forum/#!topic/boost-devel-archive/cl8B1oUPrVM
>
> 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 supports
> upward stack, Boost.Coroutine has to be changed as well.

Several years ago, I had a look at the Boehm garbage collector:

http://www.hboehm.info/gc/

IIRC, it had to determine whether the stack grew upward or
downward. I can't remember where in the code that was,
but I also vaguely remember reading (I think in the code
commets) that the method was not completely portable.

HTH.

-regards,
Larry


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