Large amx size
#1

The size of my gamemode has extremly risen since using a specific version of 0.2.
Unfortunately, this hasn't changed in 0.3.

This may not be a problem with small gamemodes, but my amx, wich has allways been about 800kb, now has a size of 3600kb.

I wanted to find out, why this happened, so i viewed the amx with a Hex Editor and I found many empty (NULL) byte blocks, wich my be the explaination of this problem.

It's not a big problem, it just causes waste of time, but I hope you can fix this in the next "server" update.
Reply
#2

pretty sure it'd be your fault creating so many variables
Reply
#3

pretty sure it's not, cause I didn't change anything on my gamemode, when changing the sa-mp version.

Please only serious answers
Reply
#4

Quote:
Originally Posted by Cypog
Посмотреть сообщение
pretty sure it's not, cause I didn't change anything on my gamemode, when changing the sa-mp version.

Please only serious answers

Edit: This is no scripting discussion, please move it back to the right topic.
Why do you think it should not have changed in size? the MAX_* constants have changed, it's guaranteed to be of different size.

WHY IS THIS A BUG WHEN YOU DON'T UNDERSTAND HOW AMX WORKS?
Reply
#5

Quote:

I found many empty (NULL) byte blocks

Why should many large blocks of NULLs not be a bug?
Reply
#6

Check all places, where you use
pawn Код:
new ...[Amount];
, to see what I mean try to make
pawn Код:
new Thing[100000];
and you will see that amx compiled will be about 100MBs.
Reply
#7

I'm not saying it's a bug in the server, but in the development files of sa-mp.

As I told:
I did not change anything in my gamemode at this time.

Yes, the MAX_ constants may have changed, but the size of a gamemode shouldn't explode.

In 0.3b the MAX_ constants also changed, but my gamemode size didn't explode again.

And why did small gamemodes not have an extreme growing of size?

Maybe it's not a "bug", but somebody should proove it, who knows how the amx exactly works.
Reply
#8

Maybe you use some inlcude what isn't "smart made" and that why size increasing so much
Reply
#9

I have many includes, but as i told: I didn't change my script.

I will compare my script with other scripts I made and report my researches.
Reply
#10

I never use these constants in my script, I always use me own constants, because I really care about performance in my scripts.

So how can this be?

Edit:
After some research, I found out, that there's really a constant wich causes this problem, I will report wich one and why after having a closer look to it.


EditІ:
I found out, that it is a design fault in one of my includes:

#if !defined PLAYER_SLOTS

#define PLAYER_SLOTS MAX_PLAYERS

#endif

I didn't change my script, but the constants did, thanks for this advice.

Editі:
This is how I fixed it:

#undef MAX_PLAYERS

#define MAX_PLAYERS 20

I recommend to everybody who's using the MAX_PLAYERS constant to redefine it to a realistic value
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)