Why do enums with a certain value give a huge AMX size?
#1

I'm kind of wanting to know something, nothing to do with me having a problem though yeah.

If you create a ENUM and store some values e.g

pawn Код:
enum E_TEST
{
    Text3D: E_LABEL = Text3D: INVALID_3DTEXT_ID,
    Text: E_TEXTDRAW = Text: INVALID_TEXT_DRAW
}
new
    e_TestData[20][E_TEST] // Giving it some index's just for the sake of it!
;
Running some code like this makes my AMX size about 3000 kb lol, why is this occurring? How can I prevent it?
Reply
#2

I doubt this is the cause of the increase in size of the amx. The data type works like the declaration of variables in PAWN but allows us programmers to manipulate large amounts of data. (Usually within arrays which is a formal method of use).
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
That enum is two cells (8 bytes) big, so 20 of them are 160 bytes, not 3000 kb. You need to find your larger ones for the culprits to that size.

Although I noticed something the other day. I've always pointed out to people that today 3 mb is really not a lot of memory. Case in point, I was editing YSI the other day and running it on a server. YSI has a fairly high memory usage, I am well aware of that, but then I noticed that the text editor I was editing the code in had a higher memory usage than the entire SA:MP server with YSI mode running in it and suddenly I didn't care (or cared even less). If put things in perspective.
Thanks mate!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)