To cater for Quake's hefty stack requirements I've had to increase the stack from 128K to 256K. It used to be 512, but I did some optimisation in R_RecursiveWorldNode to take the usage down.
I was wondering if there is a way to do this on a per .elf basis instead of modifying the global ogc.ld linkscript?
Thanks!
Specify per project stack size?
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Specify per project stack size?
That might be a useful feature to have actually.
You can adjust the stack size per thread using LWP_CreateThread though and, fwiw, the main function in a libogc app is actually the first thread started by the microkernel.
So, something like this will let you manage the stack size in your code.
You can adjust the stack size per thread using LWP_CreateThread though and, fwiw, the main function in a libogc app is actually the first thread started by the microkernel.
So, something like this will let you manage the stack size in your code.
Code: Select all
static lwp_t hmain_game = (lwp_t)NULL;
int main()
{
...
setup code
...
LWP_CreateThread( /* thread handle */ &hmain_game, /* code */ main_game, /* arg pointer for thread */ NULL, /* stack base */ NULL, /* stack size */ 512*1024, /* thread priority */ 50);
LWP_SetThreadPriority(0,0);
while(1);
}
static void* main_game(void *arg)
{
...
interesting stuff
...
}
Who is online
Users browsing this forum: No registered users and 1 guest