aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-afs.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-13 00:03:12 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-13 00:03:12 +0000
commitfd10e62048426651449da31cabeb1787bf7c3a90 (patch)
tree64f8c63287cbd29dd2f2fb1084241c16bfadf236 /epan/dissectors/packet-afs.c
parent49385a3268a69fe430e0e3fdb8279fac561f4c87 (diff)
gmemchunk -> se_alloc() improvements
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15327 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-afs.c')
-rw-r--r--epan/dissectors/packet-afs.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c
index bce4527e6e..7f249d55d8 100644
--- a/epan/dissectors/packet-afs.c
+++ b/epan/dissectors/packet-afs.c
@@ -42,6 +42,7 @@
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/addr_resolv.h>
+#include <epan/emem.h>
#include "packet-rx.h"
#include "packet-afs.h"
@@ -54,8 +55,6 @@
(opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \
(opcode >= DISK_LOW && opcode <= DISK_HIGH))
-static int afs_packet_init_count = 100;
-
struct afs_request_key {
guint32 conversation, callnumber;
guint16 service;
@@ -69,9 +68,6 @@ struct afs_request_val {
};
static GHashTable *afs_request_hash = NULL;
-static GMemChunk *afs_request_keys = NULL;
-static GMemChunk *afs_request_vals = NULL;
-
/*
@@ -154,20 +150,8 @@ afs_init_protocol(void)
{
if (afs_request_hash)
g_hash_table_destroy(afs_request_hash);
- if (afs_request_keys)
- g_mem_chunk_destroy(afs_request_keys);
- if (afs_request_vals)
- g_mem_chunk_destroy(afs_request_vals);
afs_request_hash = g_hash_table_new(afs_hash, afs_equal);
- afs_request_keys = g_mem_chunk_new("afs_request_keys",
- sizeof(struct afs_request_key),
- afs_packet_init_count * sizeof(struct afs_request_key),
- G_ALLOC_AND_FREE);
- afs_request_vals = g_mem_chunk_new("afs_request_vals",
- sizeof(struct afs_request_val),
- afs_packet_init_count * sizeof(struct afs_request_val),
- G_ALLOC_AND_FREE);
}
@@ -235,10 +219,10 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
opcode = 0;
if(!pinfo->fd->flags.visited){
if ( !request_val && !reply) {
- new_request_key = g_mem_chunk_alloc(afs_request_keys);
+ new_request_key = se_alloc(sizeof(struct afs_request_key));
*new_request_key = request_key;
- request_val = g_mem_chunk_alloc(afs_request_vals);
+ request_val = se_alloc(sizeof(struct afs_request_val));
request_val -> opcode = tvb_get_ntohl(tvb, offset);
request_val -> req_num = pinfo->fd->num;
request_val -> rep_num = 0;