too many bites used (+reputation)
#1

Edit: this is the part that causing this
PHP код:
new rowsfieldsfixer[MAX_ITEMS][ItemInfo], getstr[32]; 
PHP код:
fixer[MAX_ITEMS][ItemInfo
========================================

PHP код:
forward LoadItems();
enum ItemInfo
{
    
ID,
    
RequiredLevel,
    
Name[32],
    
Type,
    
Attack,
    
MaxHP,
    
MaxMP,
    
HPRegeneration,
    
MPRegeneration,
    
Jump,
    
Speed,
    
Slots,
    
Object
}
new 
ItemDB[MAX_ITEMS][ItemInfo];
mysql_tquery(sql"SELECT * FROM `server_item`""LoadItems");
public 
LoadItems()
{
    new 
rowsfieldsfixer[MAX_ITEMS][ItemInfo], getstr[32];
    
cache_get_data(rowsfields);
    if(
rows)
    {
        for(new 
0rowsi++)
        {
                
fixer[i][ID] = cache_get_field_content_int(i"id");
                
fixer[i][RequiredLevel] = cache_get_field_content_int(i"required_level");
                
cache_get_field_content(i"name"getstr);
                
format(fixer[i][Name], 32getstr);
                
fixer[i][Type] = cache_get_field_content_int(i"type");
                
fixer[i][Attack] = cache_get_field_content_int(i"attack");
                
fixer[i][MaxHP] = cache_get_field_content_int(i"maxhp");
                
fixer[i][MaxMP] = cache_get_field_content_int(i"maxmp");
                
fixer[i][HPRegeneration] = cache_get_field_content_int(i"hp_regeneration");
                
fixer[i][MPRegeneration] = cache_get_field_content_int(i"mp_regeneration");
                
fixer[i][Jump] = cache_get_field_content_int(i"jump");
                
fixer[i][Speed] = cache_get_field_content_int(i"speed");
                
fixer[i][Slots] = cache_get_field_content_int(i"slots");
                
fixer[i][Object] = cache_get_field_content_int(i"object");
        }
        for(new 
i=0;i<rows;i++)
        {
              
ItemDB[fixer[i][ID]][ID] = fixer[i][ID];
              
ItemDB[fixer[i][ID]][RequiredLevel] = fixer[i][RequiredLevel];
              
ItemDB[fixer[i][ID]][Type] = fixer[i][Type];
              
ItemDB[fixer[i][ID]][Attack] = fixer[i][Attack];
              
ItemDB[fixer[i][ID]][MaxHP] = fixer[i][MaxHP];
              
ItemDB[fixer[i][ID]][MaxMP] = fixer[i][MaxMP];
              
ItemDB[fixer[i][ID]][HPRegeneration] = fixer[i][HPRegeneration];
              
ItemDB[fixer[i][ID]][MPRegeneration] = fixer[i][MPRegeneration];
              
ItemDB[fixer[i][ID]][Jump] = fixer[i][Jump];
              
ItemDB[fixer[i][ID]][Speed] = fixer[i][Speed];
              
ItemDB[fixer[i][ID]][Slots] = fixer[i][Slots];
              
ItemDB[fixer[i][ID]][Object] = fixer[i][Object];
              
format(ItemDB[fixer[i][ID]][Name], 32fixer[i][Name]);
        }
    }

PHP код:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
Header size
:           3852 bytes
Code size
:            86184 bytes
Data size
:          6724496 bytes
Stack
/heap size:      16384 bytesestimated maxusage=1474573 cells (5898292 bytes)
Total requirements6830916 bytes 
Reply
#2

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Some functions/variables are pulling compiler memory a lot.

I advise you to review each function or even the variables you create.

Sometimes the variables are the ones that consume the memory of sense.
This is the one, when I remove the public it disappears, when I removed a 2500 bytes string nothing happened until I removed this specific thing

I found out that it's the fixer when I define it "new fixer[MAX_ITEMS][ItemInfo];" any idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)