This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: using split stacks
- From: Ãngel GonzÃlez <keisial at gmail dot com>
- To: Oliver Kowalke <oliver dot kowalke at gmx dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 28 Mar 2012 23:07:04 +0200
- Subject: Re: using split stacks
- References: <20120328064115.244820@gmx.net>
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