| 335 | int numMain, numExtra, numAllocMain, numAllocExtra, startExtra; |
| 336 | |
| 337 | inline void resizeMain () |
| 338 | { |
| 339 | /* This algorithm was tuned for memory&speed with this huge page: |
| 340 | * http://downloads.mysql.com/docs/refman-6.0-en.html.tar.gz |
| 341 | */ |
| 342 | if (arrayMain == NULL) { |
| 343 | this->numAllocMain = 1; |
| 344 | this->arrayMain = (T*) malloc (sizeof (T)); |
| 345 | } |
| 346 | if (this->numAllocMain < this->numMain) { |
| 347 | this->numAllocMain = (this->numMain < 100) ? |
| 348 | this->numMain : this->numMain + this->numMain/10; |
| 349 | this->arrayMain = |
| 350 | (T*) realloc(this->arrayMain, (this->numAllocMain * sizeof (T))); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | inline void resizeExtra () |
| 355 | { |