On 2017-07-04 09:28, Richmond Mathewson via use-livecode wrote:
BUT . . .

How can one know how high one can set the recursionLimit before smoke, sparks
and flames are going to start leaping out of the back of the computer?

Or, less frivolously; how can one determine the upper limit on the
recursionLimit before the
stack "hangs" (presumably that means the thing will lock solid) ?

The recursionLimit is limited by the size of the C stack (in bytes). I think on Mac that is 8 Mb by default (although I think you can configure it using ulimit or some similar command-line trickery).

One thing to check that you aren't (by accident) doing infinite recursion. i.e. A variant of:

  on myFunction
    myFunction
  end myFunction

Obviously *that* is trivially noticeable as being infinite. However, it is quite easy to write stuff like this when its buried in lots of lines of code (hence why LiveCode has a 'recursionLimit').

My general advice would be:

  1) Run your routine

  2) If it hits the recursionLimit double the recursionLimit property.

  3) Goto (1)

If you reach 8Mb limit then put some logging into your code to make sure it *does* actually need to recurse that deeply.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to