SA-MP Forums Archive
#pragma dynamic - 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: #pragma dynamic (/showthread.php?tid=531889)



#pragma dynamic - Banditukas - 15.08.2014

Hi,

I have big script and i need use this #pragma dynamic,because i get warnings for big memory use.

Now i use

Код:
#pragma dynamic 2000000
But i want to ask. What is limit of dynamic? what max number?


Re: #pragma dynamic - theYiin - 15.08.2014

I believe it is 2147483647.


Re: #pragma dynamic - Vince - 15.08.2014

You should ask yourself: why do I need to increase the memory limit in the first place? It is usually a sign of bad coding practices.

The documentation does not state a maximum limit so I suppose it would be the same as the amount of available RAM.

Quote:
Originally Posted by theYiin
Посмотреть сообщение
I believe it is 2147483647.
That may actually be true since it translates to some 8.5 gigabytes.

Edit calculated that wrong. A cell is 32 bits, not bytes. Corrected now. :$


Re: #pragma dynamic - Banditukas - 15.08.2014

Then 2000000 how much takes rams?


Re: #pragma dynamic - [XST]O_x - 15.08.2014

Try optimizing your code first.


Re: #pragma dynamic - Vince - 15.08.2014

Approximately 8 megabytes. The value is counted in cells. One cell is 32 bits. Times 2 million is 64 million bits.


AW: #pragma dynamic - Nero_3D - 15.08.2014

The byte limit remains at cellmax, so the highest possible number who #param dynamic accepts is 536870911 (cellmax / 4) otherwise it goes negative (that would be rounded off 512 MB)

But you should ask yourself that again
Quote:
Originally Posted by Vince
Посмотреть сообщение
You should ask yourself: why do I need to increase the memory limit in the first place? It is usually a sign of bad coding practices.