something about Stack/heap
#1

Код:
[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
Reply
#2

Simply it's too big

WTH are you trying to do anyway ?
Reply
#3

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.
Reply
#4

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...
Reply
#5

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

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.
Reply
#7

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...
Reply
#8

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

Then decrease arrays' size on local variables.
Reply
#9

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
Reply
#10

And also, my GM still crash...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)