PDA

View Full Version : Compile prob


ZayanImran
04/02/2013, 06:38 PM
when i compile, it give me


Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Header size: 2288 bytes
Code size: 49168 bytes
Data size: 41232 bytes
Stack/heap size: 16384 bytes; estimated max. usage=10324 cells (41296 bytes)
Total requirements: 109072 bytes


is there any prob?

plz reply...

wating

ConnorP
04/02/2013, 06:59 PM
This is what mine says when it's complied (no errors):

Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Yours doesn't look like it has any errors, but there appears to be additional information for some reason.

I don't see any errors or warning though..

MP2
04/02/2013, 07:10 PM
Use #pragma dynamic (some number)

Not sure what number. 10,000?

Kirollos
04/02/2013, 07:12 PM
Header size: 2288 bytes
Code size: 49168 bytes
Data size: 41232 bytes
Stack/heap size: 16384 bytes; estimated max. usage=10324 cells (41296 bytes)
Total requirements: 109072 bytes


ain't this shows when you compile with -d3 -r in pawn.cfg ?

Gamer_Z
04/02/2013, 07:24 PM
it means that your script needs more memory than the default allocated, you can specify how much bytes of memory you need by using

#pragma dynamic 123456

where '123456' is the size in bytes your script needs. one cell required 4 bytes.

where you see "Total requirements: 109072 bytes". it estimated your script needs, but you need to know how much you need if the compiler is warning you about this. Read the pawn-lang pdf (search this forum).

If your script does not have enough memory it will just stop executing at some point or just not load at all, and in the worst case it will crash the server.

Djole1337
04/02/2013, 08:56 PM
Note: Don't use huge variables.

Gamer_Z
05/02/2013, 11:48 AM
Note: Don't use huge variables.

sometimes you need to.

Vince
05/02/2013, 12:26 PM
Except for the occasional long SQL query, you really don't need more than 128 cells anywhere else.

Gamer_Z
05/02/2013, 03:25 PM
Except for the occasional long SQL query, you really don't need more than 128 cells anywhere else.

kidding? MAX_PLAYERS is 1000, so creating a new var[MAX_PLAYERS][enum] would be 1000*enum size cells
do that * 4 and then you have a nice amount of bytes.

Vince
05/02/2013, 03:41 PM
Global variables aren't stored on the stack. Your argument is invalid. And the value of MAX_PLAYERS is 500, still. Server owners that use the 1000 slot server surely know how to redefine a macro.

Gamer_Z
05/02/2013, 03:44 PM
Global variables aren't stored on the stack. Your argument is invalid. And the value of MAX_PLAYERS is 500, still. Server owners that use the 1000 slot server surely know how to redefine a macro.

It's stored in the heap (global), you know that?
and ofcourse I know stack is local.

Heap and stack is one memory area, and when they are initialized, stack starts being filled from the bottom and heap from the top and when they grow, the stack grows to the top and heap to the bottom. When they can't grow anymore (stack says hello to heap) you have not enough memory.

If your heap takes all the space, stack has nothing left so your script will run out of memory soon when you don't make the heap and stack size area bigger with #pragma dynamic :)

Djole1337
05/02/2013, 08:41 PM
MAX_PLAYERS is 1000

Yeah but its stupid...
#undef is your friend.

Lets say you have 50 slots, why would you keep 1k?...

#undef MAX_PLAYERS
#define MAX_PLAYERS (50)

Nero_3D
05/02/2013, 08:48 PM
It's stored in the heap (global), you know that?

Global or local static variables are stored in the amx file and not in the heap

Gamer_Z
05/02/2013, 08:53 PM
Global or local static variables are stored in the amx file and not in the heap

Pawn Logic ; >