imf: convert GHashTable to wmem_map

Change-Id: Ia5bd6af88db76bbe4e0a267c30b6f7749b23e299
Reviewed-on: https://code.wireshark.org/review/19903
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
This commit is contained in:
Dario Lombardo 2017-02-01 14:40:56 +01:00
parent 47ad059bd7
commit 179e0fbc11
1 changed files with 4 additions and 4 deletions

View File

@ -282,7 +282,7 @@ static struct imf_field imf_fields[] = {
{NULL, NULL, NULL, FALSE},
};
static GHashTable *imf_field_table=NULL;
static wmem_map_t *imf_field_table=NULL;
#define FORMAT_UNSTRUCTURED 0
#define FORMAT_MAILBOX 1
@ -773,7 +773,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
ascii_strdown_inplace (key);
/* look up the key in built-in fields */
f_info = (struct imf_field *)g_hash_table_lookup(imf_field_table, key);
f_info = (struct imf_field *)wmem_map_lookup(imf_field_table, key);
if(f_info == NULL && custom_field_table) {
/* look up the key in custom fields */
@ -1335,11 +1335,11 @@ proto_register_imf(void)
"setup and used for filtering/data extraction etc.",
headers_uat);
imf_field_table=g_hash_table_new(g_str_hash, g_str_equal); /* oid to syntax */
imf_field_table=wmem_map_new(wmem_epan_scope(), wmem_str_hash, g_str_equal); /* oid to syntax */
/* register the fields for lookup */
for(f = imf_fields; f->name; f++)
g_hash_table_insert(imf_field_table, (gpointer)f->name, (gpointer)f);
wmem_map_insert(imf_field_table, (gpointer)f->name, (gpointer)f);
/* Register for tapping */
imf_eo_tap = register_export_object(proto_imf, imf_eo_packet, NULL);