-
increase the stack size
i am using recursion to fill a polygon by checking one pixel at a time, so if the polygon is 100 x 100 pixels on the screen, then the procedure will call itself a maximum of 10000 times. Every time I get a stack overflow. If you want, i can send you the recursive function, but i don't think there is a problem with it, as it has worked based on the same principle in c++. Basically, how can i increase the amount of stack space available for my program?
thanks in advance.
-
hmmmmmm..err but dont u think that call a function 10 000 times is a little too much? why dont you just make a big loop? i bet you won't get any stack problems with it..
also are u opening in each instance of the function a new picture?
-
Yes, loop. Calling a function 10,000 times is gonna make you 20 dollars less. hehe...... LOOP = :) 10,000 = "Rather have the money"
-
i think that in my case i have to use recursion, since there is no better algorithm. so, before i give up on my problem, is it at all possible to increase the stack size?