Set minimum stack size.

Allowing low values of stack (like 4096) causes crashes on hosted. Also
confirmed that MorphOS sets minimum value here.
This commit is contained in:
deadwood 2022-07-28 06:14:18 +02:00
parent 84313d33e3
commit 29802b386d
1 changed files with 9 additions and 1 deletions

View File

@ -127,7 +127,7 @@ static const struct newMemList MemTemplate =
break;
case TASKTAG_STACKSIZE:
nml.nml_ME[1].me_Length = AROS_ALIGN(tag->ti_Data);
nml.nml_ME[1].me_Length = AROS_ALIGN((ULONG)tag->ti_Data);
break;
case TASKTAG_NAME:
@ -161,6 +161,14 @@ static const struct newMemList MemTemplate =
}
}
/* We need a minimum stack to handle interrupt contexts. Additionally confirned on MorphOS that
it sets a minimum fixed size of stack */
if (nml.nml_ME[1].me_Length < AROS_STACKSIZE)
{
nml.nml_ME[1].me_Length = AROS_STACKSIZE;
}
DADDTASK("NewCreateTaskA: name %s", taskname ? taskname : "<NULL>");
ml = NewAllocEntry((struct MemList *)&nml, NULL);