MorphOS Developer
Posts: 588 from 2003/2/24
From: finland, the l...
Quote:
domenikov wrote:
...
It does not seem to work.
The __stack variable needs to be a global. Here's a small example:
Code:
#include <iostream>
#include <proto/exec.h>
long __stack = 128 * 1024;
int main()
{
ULONG stacksize;
NewGetTaskAttrsA(NULL, &stacksize, sizeof(stacksize), TASKINFOTYPE_STACKSIZE, NULL);
std::cout << "Stack size is " << stacksize << " bytes" << std::endl;
return 0;
}
Compile it with:
Code:
g++ -noixemul -Wall -O2 stacksize.cpp -o stacksize