diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-13 06:21:37 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-13 06:21:37 +0000 |
commit | aa051bcca682844c5b7b05c0641475ab0521c1de (patch) | |
tree | d8af56207797f40950673b4b885409dfeea13a35 /epan/frame_data.c | |
parent | 46c021dffde11023b3f3c4f3371ee9a7009dbfa9 (diff) |
get rid of one more gmemchunk
svn path=/trunk/; revision=15332
Diffstat (limited to 'epan/frame_data.c')
-rw-r--r-- | epan/frame_data.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/epan/frame_data.c b/epan/frame_data.c index 092c9642e0..e448f32bb7 100644 --- a/epan/frame_data.c +++ b/epan/frame_data.c @@ -29,6 +29,7 @@ #include "frame_data.h" #include "packet.h" +#include "emem.h" #include <glib.h> @@ -39,41 +40,6 @@ typedef struct _frame_proto_data { void *proto_data; } frame_proto_data; -static GMemChunk *frame_proto_data_area = NULL; - -/* - * Free up any space allocated for frame proto data areas and then - * allocate a new area. - * - * We can free the area, as the structures it contains are pointed to by - * frames, that will be freed as well. - */ -static void -packet_init_protocol(void) -{ - - if (frame_proto_data_area) - g_mem_chunk_destroy(frame_proto_data_area); - - frame_proto_data_area = g_mem_chunk_new("frame_proto_data_area", - sizeof(frame_proto_data), - 20 * sizeof(frame_proto_data), /* FIXME*/ - G_ALLOC_ONLY); - -} - -void -frame_data_init(void) -{ - register_init_routine(&packet_init_protocol); -} - -void -frame_data_cleanup(void) -{ - /* this function intentionally left blank :) */ -} - /* XXX - I declared this static, because it only seems to be used by * p_get_proto_data and p_add_proto_data */ @@ -95,7 +61,7 @@ static gint p_compare(gconstpointer a, gconstpointer b) void p_add_proto_data(frame_data *fd, int proto, void *proto_data) { - frame_proto_data *p1 = g_mem_chunk_alloc(frame_proto_data_area); + frame_proto_data *p1 = se_alloc(sizeof(frame_proto_data)); g_assert(p1 != NULL); |