PDA

View Full Version : Total requirement


||123||
11/11/2013, 09:10 PM
For a 20% completion of my gamemode, am I currently going good?

Header size: 4396 bytes
Code size: 560740 bytes
Data size: 1435136 bytes
Stack/heap size: 16384 bytes; estimated max. usage=1233 cells (4932 bytes)
Total requirements: 2016656 bytes

Nero_3D
11/11/2013, 09:36 PM
The truth is this message doesn't tell us anything important
It just shows how much bytes the header, code, data and stack/heap uses

Just disable it and come again if the compiler pops it up by itself, than you should worry

Loot
11/11/2013, 09:39 PM
Do you use strings[256] and over in your script?

||123||
11/11/2013, 10:27 PM
Don't you think keeping track of how many bytes of RAM is being used in the script important?

Nero_3D
12/11/2013, 03:28 PM
No because you should be aware of how many bytes you use
If you split the bytes down you get around 4k that you could use in a function + all function called by the first one
Even for long strings 4000 cells are enough...

Exceptions could be a temp array for checking data in a streamer or systems with huge global arrays
But even there you could use optimise your code and go below that limit

The other numbers from header, code and data are unimportant because you cant change anything about them

||123||
12/11/2013, 04:22 PM
Let me rephrase my question: Is 1233 cells (4932 bytes) of Heap okay? And why does my bytes of stack never drop down?

Nero_3D
12/11/2013, 04:58 PM
The size of the stack/heap block needs to be known before compilation, therefore it is a fixed amount of 16kB

The 1233 cells aren't all function with local memory, it is the highest number of cells used by one function
Means there could be 50 functions using 150 cells and only one using 1233 cells

||123||
12/11/2013, 11:06 PM
So there's basically just a single function using 1233 cells instead of different local variables totaling to 1233 altogether?

Nero_3D
13/11/2013, 03:04 PM
Yes it is just one function, the obvious reason is that the stack gets reseted after each call
The call could be either a native public calling x functions or a timer public (no other way to start a function in pawn)