From 5972c3d52960a737575ae9683316bef0890cf181 Mon Sep 17 00:00:00 2001 From: AndersBroman Date: Tue, 27 Sep 2016 11:01:14 +0200 Subject: [proto.c] proto_all_finfos(), pre-allocate array to hold all fields. Change-Id: I0d41e417e57e656ccee1c2ce6bd406af4ed23d10 Reviewed-on: https://code.wireshark.org/review/17948 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/proto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'epan/proto.c') diff --git a/epan/proto.c b/epan/proto.c index 022dba9624..d610e08a5f 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -8449,7 +8449,8 @@ proto_all_finfos(proto_tree *tree) { ffdata_t ffdata; - ffdata.array = g_ptr_array_new(); + /* Pre allocate enough space to hold all fields in most cases */ + ffdata.array = g_ptr_array_sized_new(512); ffdata.id = 0; proto_tree_traverse_pre_order(tree, every_finfo, &ffdata); -- cgit v1.2.3