From 5a1ce3ca3416cdffbac4b231e5fa741ea74ad934 Mon Sep 17 00:00:00 2001 From: sahlberg Date: Sat, 13 Aug 2005 01:29:31 +0000 Subject: 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 --- epan/dissectors/packet-jxta.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'epan/dissectors/packet-jxta.c') diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index b6f04ad447..8b45509dab 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -282,9 +282,6 @@ struct jxta_stream_conversation_data { typedef struct jxta_stream_conversation_data jxta_stream_conversation_data; -static GMemChunk *my_conv_structs = NULL; -static GMemChunk *my_tap_structs = NULL; - /** * Prototypes **/ @@ -505,7 +502,7 @@ static int dissect_jxta_tcp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr tpt_conv_data = (jxta_stream_conversation_data*) conversation_get_proto_data(tpt_conversation, proto_jxta); if( NULL == tpt_conv_data ) { - tpt_conv_data = (jxta_stream_conversation_data*) g_mem_chunk_alloc(my_conv_structs); + tpt_conv_data = se_alloc(sizeof( jxta_stream_conversation_data )); tpt_conv_data->tpt_ptype = PT_NONE; tpt_conv_data->initiator_welcome_frame = 0; tpt_conv_data->initiator_address.type = AT_NONE; @@ -1163,7 +1160,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree } if ((offset > 0) && (AT_URI == pinfo->src.type) && (AT_URI == pinfo->dst.type)) { - jxta_tap_header * tap_header = (jxta_tap_header *) g_mem_chunk_alloc(my_tap_structs); + jxta_tap_header * tap_header = se_alloc(sizeof( jxta_tap_header )); tap_header->src_address = pinfo->src; tap_header->dest_address = pinfo->dst; @@ -1455,30 +1452,6 @@ static int dissect_jxta_message_element(tvbuff_t * tvb, packet_info * pinfo, pro return offset; } -static void jxta_dissector_init( void) -{ - /* destroy memory chunks if needed */ - - if ( NULL != my_tap_structs ) - g_mem_chunk_destroy( my_tap_structs ); - - - if ( NULL != my_conv_structs ) - g_mem_chunk_destroy( my_conv_structs ); - - /* now create memory chunks */ - - my_tap_structs = g_mem_chunk_new( "my_tap_structs", - sizeof( jxta_tap_header ), - 10 * sizeof( jxta_tap_header ), - G_ALLOC_ONLY); - - my_conv_structs = g_mem_chunk_new( "my_conv_structs", - sizeof( jxta_stream_conversation_data ), - 10 * sizeof( jxta_stream_conversation_data ), - G_ALLOC_ONLY); -} - /** * Register jxta protocol and jxta message protocol, header fields, subtree types, preferences. **/ @@ -1488,8 +1461,6 @@ void proto_register_jxta(void) /* register re-init routine */ - register_init_routine( &jxta_dissector_init); - proto_jxta = proto_register_protocol("JXTA P2P", "JXTA", "jxta"); jxta_tap = register_tap("jxta"); -- cgit v1.2.3