SA-MP Forums Archive
weird compiler output - 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: weird compiler output (/showthread.php?tid=385596)



weird compiler output - niels44 - 16.10.2012

hey everyone,

i just compiled my script, and now i get this, is this good or bad? and how to fix it if it has to be fixed? and what does it means?

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           3208 bytes
Code size:            50580 bytes
Data size:            44348 bytes
Stack/heap size:      16384 bytes; estimated max. usage=7311 cells (29244 bytes)
Total requirements:  114520 bytes
greets niels


Re: weird compiler output - lorizz - 16.10.2012

It's normal, because there are over 1000 strings don't worry it means how many BYTES did you use for this BIG script xD


Re: weird compiler output - niels44 - 16.10.2012

lol it isnt that bigg xD and thnx, but wont it make the server slower then?


Re: weird compiler output - gtakillerIV - 16.10.2012

Making a size of a string bigger than you need will slow down the server abit.


Re: weird compiler output - lorizz - 16.10.2012

If you have high RAM no, at least for make a server you need 8GB Ram


AW: weird compiler output - Nero_3D - 16.10.2012

That warnings appears in the compiler if a possible stack / heap collision exists
You also can get a warning while running the server, if they collide you lose stored local memory

The stack a limited place where the local variables are stored
The stack / heap memory block is by default 16 kB (4096 cells) big (could be changed)

Seach for big local variables and reduce them, its unlikely that you need over 4000 cells in a function!

Example
pawn Код:
#include <a_samp>

#define KiloByte 16

#define SIZE ((KiloByte * 1024) / 4)

main() {
    Stack();
}

Stack(count = 0) {
    new
        tmp[SIZE] = {0, 1, 2, ...}
    ;
    #pragma unused tmp

    if(0 < (--count)) {
//        Stack(count); // uncomment to get the reason "due to recursion"
    }
}



Re: weird compiler output - Babul - 16.10.2012

goto the editors settings like "run options", then search for the compiler options string, i expect it to be "-r" in your case. add "-S8192" to increase the stack/heap size to 8192 cells, which is 32768 cells.
your final compiler options string should look like
Код:
-r -S8192
after changing. if you ever get another complaint from the compiler about this, then just increase the size to like 65536 ("-S65536" then)...


Re: weird compiler output - niels44 - 16.10.2012

i dont understand you babul, but i will change the strings i setted to 5000 to 3000 xD


Re: weird compiler output - Joe Staff - 16.10.2012

I usually get this when trying to return a large array in a function
pawn Код:
stock my function()
{
    new array[10000];
    array="lol, bacon";
    return array;
}



Re: weird compiler output - niels44 - 16.10.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
No: It's not normal and you should worry! You DO NOT need to increase the stack size as babul said, you just need to stop using so many large local variables.
hmm ye, i already lowered my strings and sizes more