diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-05-02 17:21:57 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-14 19:34:12 +0000 |
commit | 0d4569851cf78e2d68a5fc5e60d977cd4f77438a (patch) | |
tree | 87aab4ca1e8aefc22a619169b0d4cd90ff8f43d4 /epan/tvbparse.c | |
parent | a7ab65df896aa2da858e0d0f8029335f19c8d034 (diff) |
tvbparse: change g_hash_table to wmem_map.
Change-Id: I245595051617f6d6333314240825a526adf19339
Reviewed-on: https://code.wireshark.org/review/15244
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/tvbparse.c')
-rw-r--r-- | epan/tvbparse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/tvbparse.c b/epan/tvbparse.c index 4cd585adf2..b5ce3c87e4 100644 --- a/epan/tvbparse.c +++ b/epan/tvbparse.c @@ -486,7 +486,7 @@ static int cond_hash(tvbparse_t* tt, const int offset, const tvbparse_wanted_t* if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_HASH) g_warning("cond_hash: got key='%s'",key); #endif - if ((value_wanted = (tvbparse_wanted_t *)g_hash_table_lookup(wanted->control.hash.table,key))) { + if ((value_wanted = (tvbparse_wanted_t *)wmem_map_lookup(wanted->control.hash.table,key))) { value_len = value_wanted->condition(tt, offset + key_len, value_wanted, &value_elem); } else if (wanted->control.hash.other) { value_len = wanted->control.hash.other->condition(tt, offset+key_len, wanted->control.hash.other, &value_elem); @@ -527,7 +527,7 @@ tvbparse_wanted_t* tvbparse_hashed(const int id, w->data = data; w->before = before_cb; w->after = after_cb; - w->control.hash.table = g_hash_table_new(g_str_hash,g_str_equal); + w->control.hash.table = wmem_map_new(wmem_epan_scope(), g_str_hash,g_str_equal); w->control.hash.key = key; w->control.hash.other = other; @@ -535,7 +535,7 @@ tvbparse_wanted_t* tvbparse_hashed(const int id, while(( name = va_arg(ap,gchar*) )) { el = va_arg(ap,tvbparse_wanted_t*); - g_hash_table_insert(w->control.hash.table,name,el); + wmem_map_insert(w->control.hash.table,name,el); } va_end(ap); @@ -552,7 +552,7 @@ void tvbparse_hashed_add(tvbparse_wanted_t* w, ...) { while (( name = va_arg(ap,gchar*) )) { el = va_arg(ap,tvbparse_wanted_t*); - g_hash_table_insert(w->control.hash.table,name,el); + wmem_map_insert(w->control.hash.table,name,el); } va_end(ap); |