Хочу узнать почему так, если я задаю общую переменную например на 1000
new string[1000];
у меня стейк
Stack/heap size: 16384 bytes; estimated max. usage=2849 cells (8200 bytes)
А когда я под каждую подсчитал у меня выходит
Stack/heap size: 16384 bytes; estimated max. usage=2249 cells (8996 bytes)
Как вообще лучше делать для экономия Так
Общий на все
new string[1000];
PHP код:
format(string,sizeof(string),"INSERT INTO `"table_bizz"`(`bID`, `bOwned`, `bOwner`,`bName`, `bEnterX`, `bEnterY`, `bEnterZ`, `bExitX`, `bExitY`, `bExitZ`, `bPrice`, `bTakings`, `bInt`, `bBizz`, `bSklad`, `bBuyprice`, `bPriceEnter`, `bClass`,`bLock`,`bBalance`) VALUES ('%i','%i','%s','%s','%f','%f','%f','%f','%f','%f','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i')",
BizzInfo[TOTALBIZZ][bID],BizzInfo[TOTALBIZZ][bOwned],BizzInfo[TOTALBIZZ][bOwner],BizzInfo[TOTALBIZZ][bName],BizzInfo[TOTALBIZZ][bEnterX],BizzInfo[TOTALBIZZ][bEnterY],BizzInfo[TOTALBIZZ][bEnterZ],BizzInfo[TOTALBIZZ][bExitX],BizzInfo[TOTALBIZZ][bExitY],BizzInfo[TOTALBIZZ][bExitZ],BizzInfo[TOTALBIZZ][bPrice],BizzInfo[TOTALBIZZ][bTakings],BizzInfo[TOTALBIZZ][bInt],BizzInfo[TOTALBIZZ][bBizz],BizzInfo[TOTALBIZZ][bSklad],
BizzInfo[TOTALBIZZ][bBuyprice],BizzInfo[TOTALBIZZ][bPriceEnter],BizzInfo[TOTALBIZZ][bClass],BizzInfo[TOTALBIZZ][bLock],BizzInfo[TOTALBIZZ][bBalance]);
mysql_tquery(con_bd, string, "","");
Или отдельно
PHP код:
new str_biz[500];
format(str_biz,sizeof(str_biz),"INSERT INTO `"table_bizz"`(`bID`, `bOwned`, `bOwner`,`bName`, `bEnterX`, `bEnterY`, `bEnterZ`, `bExitX`, `bExitY`, `bExitZ`, `bPrice`, `bTakings`, `bInt`, `bBizz`, `bSklad`, `bBuyprice`, `bPriceEnter`, `bClass`,`bLock`,`bBalance`) VALUES ('%i','%i','%s','%s','%f','%f','%f','%f','%f','%f','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i')",
BizzInfo[TOTALBIZZ][bID],BizzInfo[TOTALBIZZ][bOwned],BizzInfo[TOTALBIZZ][bOwner],BizzInfo[TOTALBIZZ][bName],BizzInfo[TOTALBIZZ][bEnterX],BizzInfo[TOTALBIZZ][bEnterY],BizzInfo[TOTALBIZZ][bEnterZ],BizzInfo[TOTALBIZZ][bExitX],BizzInfo[TOTALBIZZ][bExitY],BizzInfo[TOTALBIZZ][bExitZ],BizzInfo[TOTALBIZZ][bPrice],BizzInfo[TOTALBIZZ][bTakings],BizzInfo[TOTALBIZZ][bInt],BizzInfo[TOTALBIZZ][bBizz],BizzInfo[TOTALBIZZ][bSklad],
BizzInfo[TOTALBIZZ][bBuyprice],BizzInfo[TOTALBIZZ][bPriceEnter],BizzInfo[TOTALBIZZ][bClass],BizzInfo[TOTALBIZZ][bLock],BizzInfo[TOTALBIZZ][bBalance]);
mysql_tquery(con_bd, str_biz, "","");
Сделал ровный подсчёт
PHP код:
static const biz[] = "INSERT INTO `"table_bizz"`(`bID`, `bOwned`, `bOwner`,`bName`, `bEnterX`, `bEnterY`, `bEnterZ`, `bExitX`, `bExitY`, `bExitZ`, `bPrice`, `bTakings`, `bInt`, `bBizz`, `bSklad`, `bBuyprice`, `bPriceEnter`, `bClass`,`bLock`,`bBalance`) VALUES ('%i','%i','%s','%s','%f','%f','%f','%f','%f','%f','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i')";
new str_biz[sizeof(biz) + 250 + MAX_PLAYER_NAME - 40];
format(str_biz, sizeof(str_biz), biz, BizzInfo[TOTALBIZZ][bID],BizzInfo[TOTALBIZZ][bOwned],BizzInfo[TOTALBIZZ][bOwner],BizzInfo[TOTALBIZZ][bName],BizzInfo[TOTALBIZZ][bEnterX],BizzInfo[TOTALBIZZ][bEnterY],BizzInfo[TOTALBIZZ][bEnterZ],BizzInfo[TOTALBIZZ][bExitX],BizzInfo[TOTALBIZZ][bExitY],BizzInfo[TOTALBIZZ][bExitZ],BizzInfo[TOTALBIZZ][bPrice],BizzInfo[TOTALBIZZ][bTakings],BizzInfo[TOTALBIZZ][bInt],BizzInfo[TOTALBIZZ][bBizz],BizzInfo[TOTALBIZZ][bSklad],
BizzInfo[TOTALBIZZ][bBuyprice],BizzInfo[TOTALBIZZ][bPriceEnter],BizzInfo[TOTALBIZZ][bClass],BizzInfo[TOTALBIZZ][bLock],BizzInfo[TOTALBIZZ][bBalance]);
mysql_tquery(con_bd, str_biz, "","");
Стейк показывает вообще
Stack/heap size: 16384 bytes; estimated max. usage=2315 cells (9260 bytes)