This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
forcing a variable to be on the stack
- From: Mathieu Lacage <mathieu dot lacage at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 6 Oct 2010 17:11:27 +0200
- Subject: forcing a variable to be on the stack
Is there a way to ask gcc to force a specific variable to be stored on
the stack ? (other than write a bit of inline asm ?)
I tried something along the lines of the following (volatile on the
thread variable) and it appears to work but it's ugly and it's
probably stupid.
{
volatile PthreadFiberThread *thread = fiber->thread;
pthread_cond_wait ((pthread_cond_t*)&thread->condvar,
(pthread_mutex_t*)&thread->mutex);
thread->trampoline->Jump ((PthreadFiberThread *)thread);
}
Mathieu
--
Mathieu Lacage <mathieu.lacage@gmail.com>