estimated max. usage: unknown, due to recursion - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: estimated max. usage: unknown, due to recursion (
/showthread.php?tid=578681)
estimated max. usage: unknown, due to recursion -
MW - 21.06.2015
pawn Код:
Header size: 6756 bytes
Code size: 1867228 bytes
Data size: 15431628 bytes
Stack/heap size: 32768 bytes; estimated max. usage: unknown, due to recursion
Total requirements:17338380 bytes
What's the problem??!!
AW: estimated max. usage: unknown, due to recursion -
Nero_3D - 21.06.2015
The message appears if the compiler thinks that your scripts could case a heap / stack collision
That happens if one of your function uses to much local memory
In your case the compiler couldn't calculate it because your function is recursive like
pawn Код:
stock pCountdown(count) if(count> 0) printf("%d", count), pCountdown(--count); else print("Start");
You should change that code to a for / while loop
Its not something to worry about
if you know what you are doing (many people don't)
But still you should take a look inside the code and check if you can reduce the stack usage (local variables) or make it non recursive
If a real collision happens (while running the script) you will get an error message in your samp-server console
Alternative you can increase the stack size but thats is not a solution only a workaround
Re: estimated max. usage: unknown, due to recursion -
MW - 21.06.2015
How can I find that function?
AW: estimated max. usage: unknown, due to recursion -
Nero_3D - 21.06.2015
If you got this message only recently, think over what you changed / added it should somehow look like the example I posted above (it recalls itself)
You could also try to comment functions and recompile your code to see if the message still appears