BR 4.2 significantly increased the limits for workstack values. Before that the limit was 65535 bytes and if you use a lot of deeply embedded library functions you quickly run into this limit.
If you tried to set a workstack higher then 65535, you wouldn't get an error.. the workstack you ended up with would be the remainder of the workstack you specified after it was divided by 65536. For example, a workstack of 65536 would result in 0, 65537 would result in 1, 65538 would become 2 and so on, all the way up to 131071 which would result in 65535 again, and 131072 which would loop again back around to 0.
I often wondered why they never instituted an error and instead dealt with invalid numbers in this slightly confusing manner. But now I understand the usefulness of it.
I was trying to increase the workstack to take advantage of the new limits in 4.2 which are over 1,000,000 bytes, but I wanted it to still work under BR 4.1. So I came up with the following numbers, that work in both BR 4.2 and BR 4.1:
Code: Select all
WORKSTACK 983039
RPNSTACK 262143
FLOWSTACK 262143
FORSTACK 131071
I could have made them all 983039 but I didn't want to use an additional 4MB of memory right off the top, and you really only need a large number for Workstack. In my experience, the other stacks don't get used nearly as much as the workstack does.
Anyway, there it is, my useless mathematical exercise for the day. I hope you all enjoyed this exciting foray into the forests of unnecessary logic.
Gabriel