summaryrefslogtreecommitdiff
path: root/epan/proto.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-03-02 09:28:30 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-03-02 09:28:30 +0000
commitbfcf193d2f378a12d50d022d2d5c391e621a3321 (patch)
tree84e9428800c157df00c38454cb31ecd4e28bfee4 /epan/proto.c
parent334a807e14dc0054d5bd10d3b7b7e713d25bb927 (diff)
downloadwireshark-bfcf193d2f378a12d50d022d2d5c391e621a3321.tar.gz
Increase the size of the preallocated area for hf fields.
svn path=/trunk/; revision=41290
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/proto.c b/epan/proto.c
index b32d76a630..576da4f887 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -4954,6 +4954,7 @@ tmp_fld_check_assert(header_field_info *hfinfo) {
}
}
+#define PROTO_PRE_ALLOC_HF_FIELDS_MEM 120000
static int
proto_register_field_init(header_field_info *hfinfo, const int parent)
{
@@ -4972,11 +4973,12 @@ proto_register_field_init(header_field_info *hfinfo, const int parent)
/* if we always add and never delete, then id == len - 1 is correct */
if(gpa_hfinfo.len>=gpa_hfinfo.allocated_len){
if(!gpa_hfinfo.hfi){
- gpa_hfinfo.allocated_len=100000;
- gpa_hfinfo.hfi=g_malloc(sizeof(header_field_info *)*100000);
+ gpa_hfinfo.allocated_len=PROTO_PRE_ALLOC_HF_FIELDS_MEM;
+ gpa_hfinfo.hfi=g_malloc(sizeof(header_field_info *)*PROTO_PRE_ALLOC_HF_FIELDS_MEM);
} else {
gpa_hfinfo.allocated_len+=1000;
gpa_hfinfo.hfi=g_realloc(gpa_hfinfo.hfi, sizeof(header_field_info *)*gpa_hfinfo.allocated_len);
+ /*g_warning("gpa_hfinfo.allocated_len %u",gpa_hfinfo.allocated_len);*/
}
}
gpa_hfinfo.hfi[gpa_hfinfo.len]=hfinfo;