Increase space allocated for IO Graph slower after 1 million items

Change-Id: I691070b572e519f412a80db5d7415331f07e8e50
Reviewed-on: https://code.wireshark.org/review/2689
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
This commit is contained in:
Balint Reczey 2014-06-27 17:36:32 +02:00
parent 524583298b
commit f90bf8ae2a
1 changed files with 3 additions and 1 deletions

View File

@ -270,7 +270,9 @@ tap_iostat_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void *
if (idx + 1 > io->num_items) {
if (idx + 1 > io->space_items) {
/* reallocate graphs */
const gsize new_size = exp2(log2(idx + 1) + 1);
static const gsize exp_inc_limit = 1000000;
static const gsize step = 100000;
const gsize new_size = (idx < exp_inc_limit)?exp2(log2(idx + 1) + 1):(idx + step);
if (io->space_items == 0) {
/* nothing allocated yet */
int i;