diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-13 01:29:31 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-13 01:29:31 +0000 |
commit | c30eeef7d8789f3acc7f69399fa8de2e96d7be9b (patch) | |
tree | 4c1e67fe96ae22ada16a068ddc90db3ee895673a /epan/dissectors/packet-jxta.c | |
parent | 00f05d88920b91e650a36bd119b42d7fd7691b84 (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.
svn path=/trunk/; revision=15328
Diffstat (limited to 'epan/dissectors/packet-jxta.c')
-rw-r--r-- | epan/dissectors/packet-jxta.c | 33 |
1 files changed, 2 insertions, 31 deletions
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"); |