After reading the following question, I understand that there no such thing exist (at least not 'portable').
However I am starring at the following piece of code from mono code base, which return a pointer to the stack:
static void *
return_stack_ptr ()
{
gpointer i;
return &i;
}
I am surprised that the above code can even work on arch such as PowerPC, I would have assumed this would only work on x86 (and maybe only gcc).
Is this going to work on PowerPC ?
iin another memory other than the stack. Nevertheless, I'd say it will work with any mainstream PowerPC compilerisomewhere in memory, if you (correctly) use its address. There's no choice.&ipoints inside the stack. However, there is no guarantee that "the stack" is a contiguous memory area, or that&iis located at either end, or that you can do pointer arithmetic on&i.