Bad array causing Stack/heap - 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: Bad array causing Stack/heap (
/showthread.php?tid=302607)
Bad array causing Stack/heap -
Kar - 09.12.2011
Well I got a little problem.
pawn Код:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 26252 bytes
Code size: 2789960 bytes
Data size: 2510248 bytes
Stack/heap size: 32000 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 5358460 bytes
The compiler was causing due to a bug, so I debugged my whole script to find it, and fixed it. (badly used switch statement) so now after I fixed that, the script started giving this, so obviously I need some way to find a bad array (it's a array that was initialized wrong, I've gotten this problem before, it also makes your amx size jump)
It has 46.6k lines and you know.. I can't exactly look through every line to find the problem
Re: Bad array causing Stack/heap -
MadeMan - 09.12.2011
Quote:
Originally Posted by Kar
... I can't exactly look through every line to find a bug
|
If you don't remember the last thing you changed when it first happened, there is no other way than going line by line.
Re: Bad array causing Stack/heap -
Kar - 09.12.2011
Okay.. but maybe are there any examples of bad arrays that could cause this on the forums so I can try to search easier..
Re: Bad array causing Stack/heap -
MadeMan - 09.12.2011
Your stack/heap size is 32000 bytes (8000 cells) so look for local arrays that are bigger than 8000 cells.
Or it could be many big arrays together, for example
pawn Код:
new array1[4000];
new array2[4000];
new array3[4000];
4000 + 4000 + 4000 = 12000 so it's a problem.