Sopok
May 23rd, 2001, 11:38 PM
does anyone know how to extend the stack space or flush a stack ? i'm working with nested loops and can't find a way to get around this problem...anyone?
|
Click to See Complete Forum and Search --> : out of stack space error Sopok May 23rd, 2001, 11:38 PM does anyone know how to extend the stack space or flush a stack ? i'm working with nested loops and can't find a way to get around this problem...anyone? Cimperiali May 24th, 2001, 02:49 AM "i'm working with nested loops " You sure each loop has an exit that will be sured reached (non infinite loop)? Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus. Cimperiali May 24th, 2001, 03:27 AM ...and beware of recursion, too... Have nice streets under your wheels Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus. Sopok May 24th, 2001, 08:39 PM its kind recursive too...i've terminated every if with an end if..my problem is that it uses an algorithm that searches its methods and uses them recursively..over and over again. There's no infinite loop its just that i need a bigger stack space (if possible) or a way to overcome this problem. Thanks for your replies anyway! shree May 24th, 2001, 08:58 PM If you are using recursion, you should optimise your function for recursion. Make it small and efficient. Use as less variables in it as possible. Use less variables as parameters. If your algorithm is eating up all of tha available stack space, then you'd better consider a solution that replaces the recursion with an iteration. There is almost always an iterative counterpart to a recursion. Memory requirement of an iterative solution is not a big problem because then you can use dynamic arrays. And you'll get an added speed advantage if you use iteration instead of recursion. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |