Stack Size object
James Long
Posts: 1,181
Ok, I'm not a noob, but I have a question..
I have a program that I would like to test the required stack size. The program has multiple tiers, what is the best way to test?
Would I need to test each object independently, or test the whole group at once?
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
I have a program that I would like to test the required stack size. The program has multiple tiers, what is the best way to test?
Would I need to test each object independently, or test the whole group at once?
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
Comments
Create a stack. Usually variable space is initialized with zeros. Run whatever test-code you want to run and then check the stack. The stack position with the last non-zero value should give you a good indication for the maximum stack size.
Well there is a stack object already, I just wondering if I can test with it using the total code, or must test each object separately.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
You have to test with the hole program. If you want the absolute maximum stacksize you have to make sure
that the program runs in that way that it branches to that methods that will cause the maximum of nested calls
with the maximum of parameters.
This means to find out the REAL maximum you have to let it run in a lot of variants of how to branch to different methods
A pragmatic solution to this is: as long as you are not running out of RAM is to set the stack to secure big values
use the stacksize-object with an average program-run and add 20-30%
best regards
Stefan