Adriaan van Os wrote:
The failures in nonloc2goto.pas and nonloc4goto.pas go away when increasing the stacksize limit. We might reduce the recursion depth somewhat in these tests, in order to run them in the default Mac OS X stacksize limit of 512 KB.
I'm a bit surprised. Depth 10000 with only one integer parameter shouldn't take much stack -- 16 bytes per recursion on my system. Is the procedure call overhead (WRT stack usage) so big on the Mac?
Actually the point is to use up some amount of stack, something like 32-64 KB is more than sufficient.
So perhaps they should be rewritten to use fewer recursions with more parameters to reduce the overhead, so the minimum stack usage (as given by parameter sizes alone) is still >= 32 KB, and the usage on the Mac is acceptable. Feel free to experiment and send me the results.
Please note that nonloc4goto.pas does some useless computations in order to avoid tail call optimization. Also, make sure that all parameters are actually used (non-trivially), so they can't possibly be optimized away.
Frank