Link error on taskHeadroom()
Link error on taskHeadroom()
I cannot use System.TaskHeadRoom() in my code. The linker fails to find taskHeadroom in zxLib 2.5.2
Mike Perks
Re: Link error on taskHeadroom()
The entry point was missing from the library. You can try the experimental (i.e. not fully tested) ZX Library v2.5.5. The .zip file contains an updated change history.mikep wrote:I cannot use System.TaskHeadRoom() in my code. The linker fails to find taskHeadroom in zxLib 2.5.2
- Don Kinzer
I have tested the new ZX library code and it works fine on a ZX24n. Here is some empirical data about the relative size of task stacks. These numbers have no margin at all.
[table][mrow]Task[mcol]ZVM Stack[mcol]Native Stack[mcol]Growth
[row]Main[col]103[col]281[col]286%
[row]Task1[col]32[col]63[col]197%
[row]Task2[col]32[col]71[col]222%
[row]Task3[col]72[col]100[col]139%
[row]Task4[col]60[col]115[col]192%
[row]Task5[col]36[col]85[col]236%
[/table]
It is usual to have a ZVM stack margin of 10 bytes. I would suggest for a native mode device that this translates into a 30 byte margin. Here is some sample output from a ported native mode application using System.TaskHeadRoom()
Note that if you over allocate RAM, a task may still start ok but the stack headroom may get returned as &hFFFF.
[table][mrow]Task[mcol]ZVM Stack[mcol]Native Stack[mcol]Growth
[row]Main[col]103[col]281[col]286%
[row]Task1[col]32[col]63[col]197%
[row]Task2[col]32[col]71[col]222%
[row]Task3[col]72[col]100[col]139%
[row]Task4[col]60[col]115[col]192%
[row]Task5[col]36[col]85[col]236%
[/table]
It is usual to have a ZVM stack margin of 10 bytes. I would suggest for a native mode device that this translates into a 30 byte margin. Here is some sample output from a ported native mode application using System.TaskHeadRoom()
Code: Select all
Main 44
Indicators 30
Receive 30
Send 30
Update 30
Watchdog 44
Mike Perks