diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-13 01:29:31 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-13 01:29:31 +0000 |
commit | 5a1ce3ca3416cdffbac4b231e5fa741ea74ad934 (patch) | |
tree | 4c1e67fe96ae22ada16a068ddc90db3ee895673a /epan/dissectors/packet-ncp.c | |
parent | fd10e62048426651449da31cabeb1787bf7c3a90 (diff) |
some more gmemchunk -> se_alloc() updates
there are only 5 gmemchunks left but they have different litetime for their allocations than the 100+ ones that have been removed.
The remaining 5 should be converted some other way.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15328 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ncp.c')
-rw-r--r-- | epan/dissectors/packet-ncp.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c index b8b716e1c9..9b39dfd32d 100644 --- a/epan/dissectors/packet-ncp.c +++ b/epan/dissectors/packet-ncp.c @@ -45,6 +45,7 @@ #include <string.h> #include <glib.h> #include <epan/packet.h> +#include <epan/emem.h> #include <epan/prefs.h> #include "packet-ipx.h" #include "packet-tcp.h" @@ -203,8 +204,6 @@ typedef struct { } mncp_rhash_value; static GHashTable *mncp_rhash = NULL; -static GMemChunk *mncp_rhash_keys = NULL; -static GMemChunk *mncp_rhash_values = NULL; /* Hash Functions */ static gint @@ -233,20 +232,8 @@ mncp_init_protocol(void) { if (mncp_rhash) g_hash_table_destroy(mncp_rhash); - if (mncp_rhash_keys) - g_mem_chunk_destroy(mncp_rhash_keys); - if (mncp_rhash_values) - g_mem_chunk_destroy(mncp_rhash_values); mncp_rhash = g_hash_table_new(mncp_hash, mncp_equal); - mncp_rhash_keys = g_mem_chunk_new("mncp_rhash_keys", - sizeof(mncp_rhash_key), - 200 * sizeof(mncp_rhash_key), - G_ALLOC_ONLY); - mncp_rhash_values = g_mem_chunk_new("mncp_rhash_values", - sizeof(mncp_rhash_value), - 200 * sizeof(mncp_rhash_value), - G_ALLOC_ONLY); } /* After the sequential run, we don't need the ncp_request hash and keys @@ -265,10 +252,10 @@ mncp_hash_insert(conversation_t *conversation) /* Now remember the request, so we can find it if we later a reply to it. */ - key = g_mem_chunk_alloc(mncp_rhash_keys); + key = se_alloc(sizeof(mncp_rhash_key)); key->conversation = conversation; - value = g_mem_chunk_alloc(mncp_rhash_values); + value = se_alloc(sizeof(mncp_rhash_value)); value->packet_signature = FALSE; g_hash_table_insert(mncp_rhash, key, value); |