summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/epan.c2
-rw-r--r--epan/frame_data.c38
-rw-r--r--epan/frame_data.h6
3 files changed, 2 insertions, 44 deletions
diff --git a/epan/epan.c b/epan/epan.c
index f4a75eae50..1a289e396e 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -60,7 +60,6 @@ epan_init(const char *plugin_dir, void (*register_all_protocols)(void),
report_read_failure_func = report_read_failure;
except_init();
tvbuff_init();
- frame_data_init();
tap_init();
proto_init(plugin_dir,register_all_protocols,register_all_handoffs);
packet_init();
@@ -75,7 +74,6 @@ epan_cleanup(void)
dfilter_cleanup();
proto_cleanup();
packet_cleanup();
- frame_data_cleanup();
tvbuff_cleanup();
except_deinit();
host_name_lookup_cleanup();
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);
diff --git a/epan/frame_data.h b/epan/frame_data.h
index 7582ad216a..05c28859da 100644
--- a/epan/frame_data.h
+++ b/epan/frame_data.h
@@ -84,10 +84,4 @@ extern void p_add_proto_data(frame_data *, int, void *);
extern void *p_get_proto_data(frame_data *, int);
extern void p_rem_proto_data(frame_data *fd, int proto);
-/* An init routine to be called by epan_init */
-extern void frame_data_init(void);
-
-/* A cleanup routine to be called by epan_cleanup */
-extern void frame_data_cleanup(void);
-
#endif /* __FRAME_DATA__ */