update: Set thread stack size to 512 KiB
Empire 2 settled on this formula for the stack size: stacksize = 100000 + /* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) + sizeof(char *)); Obviously attempts to provide space for a known configuration- dependent stack hog. The hog went away when finish_sects()'s arrays became dynamically allocated in 4.2.0. Adjusting for that by dropping the extra term might well do (I observe only a few KiB of stack used on my system). But let's set it to 512 KiB instead to be on the safe side. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
030b374db7
commit
0f84c009bf
1 changed files with 1 additions and 6 deletions
|
@ -69,7 +69,6 @@ void
|
|||
update_init(void)
|
||||
{
|
||||
struct player *dp;
|
||||
int stacksize;
|
||||
|
||||
update_schedule_anchor = (time(NULL) + 59) / 60 * 60;
|
||||
if (update_get_schedule() < 0)
|
||||
|
@ -78,11 +77,7 @@ update_init(void)
|
|||
dp = player_new(-1);
|
||||
if (!dp)
|
||||
exit_nomem();
|
||||
/* FIXME ancient black magic; figure out true stack need */
|
||||
stacksize = 100000 +
|
||||
/* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) +
|
||||
sizeof(char *));
|
||||
update_thread = empth_create(update_sched, stacksize, 0, "Update", dp);
|
||||
update_thread = empth_create(update_sched, 512 * 1024, 0, "Update", dp);
|
||||
if (!update_thread)
|
||||
exit_nomem();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue