S sorex Expert Licensed User Longtime User Jul 29, 2016 #1 Hello, Are there any stack flushing options that we can use? I have a routine that does some recursive calls. All works fine the first time. When I run it again it halfway ends with a stack overflow error. When I add some startsub/endsub logging I see that it ends all sub calls at the first run so the stacks should be as before pressing the button.
Hello, Are there any stack flushing options that we can use? I have a routine that does some recursive calls. All works fine the first time. When I run it again it halfway ends with a stack overflow error. When I add some startsub/endsub logging I see that it ends all sub calls at the first run so the stacks should be as before pressing the button.
S sorex Expert Licensed User Longtime User Jul 29, 2016 #2 ok, I found the culprit changing B4X: Sub scan(X,Y,c) to B4X: Sub scan(X as int,Y as int,c as int) makes the stack overflow go away. doesn't make sense but I guess it's starting a lot of background subs (stringbuilers etc) when the type is undefined thus string. Upvote 0
ok, I found the culprit changing B4X: Sub scan(X,Y,c) to B4X: Sub scan(X as int,Y as int,c as int) makes the stack overflow go away. doesn't make sense but I guess it's starting a lot of background subs (stringbuilers etc) when the type is undefined thus string.