enum size +rep
#1

well i have made a system and this system enum has more than 10 things,each one thing is like this:
pawn Код:
enum something
{
    something1[1000],
    something2[1000],
    something3[1000],
    something4[1000],
    something5[1000],
    something6[1000],
    something7[1000],
    something8[1000],
    something9[1000],
    something10[1000],
};
new info[max_somethings][something]; //max_something is 250
when i compile i get alot of size,how is it possible to optimize this enum and make it better?
Reply
#2

It is very large the size of the amx because you lot of memory in your variables, to optimize that you need to search the parts of code that used these variables, count the maximum number of characters(+1charcater null) and put it in place of " 1000 ".
Reply
#3

i said i am using these 1000 things,max is 1000 and you can get any thing from 0 to 1000
Reply
#4

I doubt that you save 10 thousand characters in each player, so that is the only solution friend, you must make good use of the variable strings, there is no other way to optimize, optimize in string variables is to declare the maximum number of characters to optimize and avoid wasting memory, if you occupy all of that memory there is no waste and don't need optimize anything .

10,000 x 250 x 4 = 10000000
Reply
#5

anyone?
Reply
#6

What are you using these variables for?
Reply
#7

i dont know if this work
PHP код:
#define ze 0
something[ze char]
function(){ 
#if defined ze
#undef ze
#define ze 1000
#endif

Reply
#8

Packed strings
Reply
#9

i am using them for creating cars and objects and,...
Reply
#10

Seems to me you have excessive sized arrays re-evaluate what you actually need.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)