SA-MP Forums Archive
something about 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: something about Stack/heap (/showthread.php?tid=434775)



something about Stack/heap - yxliang - 04.05.2013

Код:
[14:21:56] [debug]  Stack pointer (STK) is 0xE60160, heap pointer (HEA) is 0xE6016C
[14:21:56] Script[gamemodes/gc-rp.amx]: Run time error 3: "Stack/heap collision (insufficient stack size)"
There are messages display when my gamemode init. What caused that and how to solve that?

Код:
#pragma dynamic 130000000000000000000000000000000000000000
I put it into the top of my GM. But when my compile it, displayed
Header size: 19840 bytes
Code size: 3193036 bytes
Data size: 15071820 bytes
Stack/heap size: 0 bytes; estimated max. usage: unknown, due to recursion
Total requirements:18284696 bytes


Re: something about Stack/heap - park4bmx - 04.05.2013

Simply it's too big

WTH are you trying to do anyway ?


Re: something about Stack/heap - Yashas - 04.05.2013

Just remove that.The compiler knows better than programmers how much to set the stack,heap size.So allow it for the compiler.

Or do you have any specific reason of you defining the size??

Actually you have crossed the limit and thats the problem.

Its better you let the compiler do that job.


Re: something about Stack/heap - yxliang - 04.05.2013

Quote:
Originally Posted by Yashas
Посмотреть сообщение
Just remove that.The compiler knows better than programmers how much to set the stack,heap size.So allow it for the compiler.

Or do you have any specific reason of you defining the size??

Actually you have crossed the limit and thats the problem.

Its better you let the compiler do that job.
I removed it and still have that problem...


Re: something about Stack/heap - MP2 - 04.05.2013

If your total requirements are 18284696, why on earth have you set it to 10000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000


Re: something about Stack/heap - Yashas - 04.05.2013

Quote:
Originally Posted by yxliang
Посмотреть сообщение
I removed it and still have that problem...
The same problem?? -_- Check your code if you have put it somewhere else.You said the error came only when you added that pragma?It must have got fixed after removing it.

Quote:
Originally Posted by MP2
Посмотреть сообщение
If your total requirements are 18284696, why on earth have you set it to 10000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000
Agreed!!
He must have been trying to fill his RAM full and see what happens.


Re: something about Stack/heap - yxliang - 06.05.2013

Quote:
Originally Posted by Yashas
Посмотреть сообщение
The same problem?? -_- Check your code if you have put it somewhere else.You said the error came only when you added that pragma?It must have got fixed after removing it.



Agreed!!
He must have been trying to fill his RAM full and see what happens.
However, PAWN don't allow me to set it.... It is too long...


Re: something about Stack/heap - GiamPy. - 06.05.2013

Because your gamemode is not optimized /at all/.
Remove that #pragma string, first of all.

Then decrease arrays' size on local variables.


Re: something about Stack/heap - Killa[DGZ] - 06.05.2013

Have you tried lowering the string values within your script.. you must have lots of really big ones

First check how big they need to be in order to hold the specified information. Just use a online string counter (****** it) to check the data you wish to store within the string first, if a player name is included within that string, then you'll need to add 24 to the strings total size.


Hope that helps


Re: something about Stack/heap - yxliang - 06.05.2013

And also, my GM still crash...