PDA

View Full Version : Bad array causing Stack/heap


Kar
09/12/2011, 08:26 PM
Well I got a little problem.

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

MadeMan
09/12/2011, 08:29 PM
... 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.

Kar
09/12/2011, 08:48 PM
Okay.. but maybe are there any examples of bad arrays that could cause this on the forums so I can try to search easier..

MadeMan
09/12/2011, 08:59 PM
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


new array1[4000];
new array2[4000];
new array3[4000];


4000 + 4000 + 4000 = 12000 so it's a problem.