Little question about #pragma, thank you. - 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: Little question about #pragma, thank you. (
/showthread.php?tid=479788)
Little question about #pragma, thank you. -
NeMoK - 07.12.2013
Hi guys.
I want to ask you something about #pragma.
I am scripting a 30.000+ lines RP gamemode, and I had a problem with "Stack/heap size".
I found the solution to the warning using #pragma dynamic 145000, now the warning doesn't appear.
But, I want to know, it there are some downsides, using it.
Re: Little question about #pragma, thank you. - Patrick - 07.12.2013
I believe #pragma dynamic increases the size of the stack, so basically removed the specific warning message on the compiler, same as #pragma tabsize removes the Loose Indentation warning.
I suggest you read this:
https://sampforum.blast.hk/showthread.php?tid=57018 and this:
https://sampforum.blast.hk/showthread.php?tid=216730
but if you are
compiling your gamemode with
-d3 I believe it's normal, since I get this when I compile with
-d3
Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Header size: 5048 bytes
Code size: 156760 bytes
Data size: 17374600 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:17552792 bytes
[Finished in 7.5s]
One possible chance that can cause stack/heapsize, bad usaged of array, for example
pawn Код:
new _Array1[5000], _Array2[5000], _Array3[5000]; // 5,000 x 3 = 15,000
One possible chance that can cause Loose Indentation, bad indentation, for example
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, -1, "Message 1");
SendClientMessage(playerid, -1, "Message 2");
SendClientMessage(playerid, -1, "Message 3");
SendClientMessage(playerid, -1, "Message 4");
return true;
}