Under what conditions would I get no warning about an excessively small task stack in Native mode?
I have 2 tasks running. I had the tasks sized for the ZVM mode, and when I compiled under Native mode one of the task stacks got an error indicating that the stack needed to be at least 70 bytes larger (120 vs 50).
I got no warning about the other task stack, but I was getting odd stuff happening and I tracked it down (I think) to the task stack being rather too small. Since I got no warning, I had no good idea about how big to make it, so I added 100 bytes just as a starting point. This seems to be OK because I no longer have any oddities (other than the evaluation of the Select Case statements).
Is there a way for me to determine how big I need the task stack to be in Native mode?
-Tony
Task Stack Warning in Native mode
Re: Task Stack Warning in Native mode
Recent versions of the compiler calculate the task stack size for native mode. The results are believed to be accurate; typically producing a required stack size that is larger than the value calculated by subtracting the value returned by System.TaskHeadRoom() from the actual task stack size. Of course, you need to be certain that your task is well-exercised prior to requesting the headroom calculation; otherwise, you may get a misleading result.spamiam wrote:Is there a way for me to determine how big I need the task stack to be in Native mode?
It is certainly possible that there is an error in the calculation algorithm that causes the computed value to be less than the observed value. I would very much like to take a look at ZBasic code that produces such a result.
- Don Kinzer
Re: Task Stack Warning in Native mode
I suppose that the fact that I did not get a warning on the second task, whose stack was evidently too small (because it was clobbering other variables) indicates that it was calculating too small a stack size.dkinzer wrote:It is certainly possible that there is an error in the calculation algorithm that causes the computed value to be less than the observed value. I would very much like to take a look at ZBasic code that produces such a result.
I will clip the code for the task including the variable allocations and get it to you this evening when I get home.
-Tony
I tested the stack warning just now after fixing up some other stuff. I set the stack too low again (adequate for ZVM mode) and I got an error. I may have missed it because I get a few other errors about variables being hiding some system functions and some of my global variables.
I think the stack warning is working properly.
-Tony
I think the stack warning is working properly.
-Tony