On 28/03/12 08:41, Oliver Kowalke wrote:
> Hello,
>
> I'd like to use split stacks for my coroutine implementation.
> I found a website from Ian describing how split stack could be implemented in gcc but not how to use it in an application.
>
> I assume I have to apply the command line option -fsplit-stack and gcc must be compiled with --enable-gold (as described in Ians blog).
> Are some macros defined I can use in the code in order to detect that split stacks are available?
>
> I assume I've to call a special function similiar to malloc()/calloc() in order to get a new split stack?!
>
> regards,
> Oliver
I thought split stacks were just the name of the feature of having a
non-necessarily contiguous stack which gets allocated on demand. You
will obviously need some kind of malloc() to create a stack for you, but
as the compiler will need to know about it, probably not anyone works.
There may be some kind of stack_alloc(), I'd take a look at how does
pthread_create() make its stack.
Good luck
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]