How to avoid stack overflow

Q&A's, tips, howto's
Locked
ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

How to avoid stack overflow

Post by ssqq »

I don't know how resume stack space in newLISP.

If I use one function do too much thiings, then the stack of function may occur stack overflow?

If i reject the return value when call other function, then would avoid stack overflow?

If anyone could give me some advise?

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: How to avoid stack overflow

Post by rickyboy »

ssqq wrote:I don't know how resume stack space in newLISP.

If I use one function do too much thiings, then the stack of function may occur stack overflow?

If i reject the return value when call other function, then would avoid stack overflow?

If anyone could give me some advise?
I don't understand what you are trying to do. Could you give an example (code) to clarify?

(The only guess I can venture is that you are doing recursive calls and blowing up the stack and you may be asking if newLISP has tail call optimization. It doesn't. All recursive calls add to the stack and there is no way of avoiding that in newLISP, as far as I know.)
(λx. x x) (λx. x x)

Locked