MCPcopy Create free account
hub / github.com/dillo-browser/dillo / resizeMain

Method resizeMain

lout/misc.hh:337–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

setSizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected