Commit b41c935f authored by Wim Taymans's avatar Wim Taymans

Use GstMemChunk to allocate events

Original commit message from CVS:
Use GstMemChunk to allocate events
parent 76b9ffbd
......@@ -24,6 +24,7 @@
#include "gstinfo.h"
#include "gstdata_private.h"
#include "gstmemchunk.h"
#include "gstevent.h"
#include "gstlog.h"
......@@ -33,6 +34,8 @@
static GstAllocTrace *_event_trace;
#endif
static GstMemChunk *chunk;
/* #define MEMPROF */
GType _gst_event_type;
......@@ -48,6 +51,9 @@ _gst_event_initialize (void)
#ifndef GST_DISABLE_TRACE
_event_trace = gst_alloc_trace_register (GST_EVENT_TRACE_NAME);
#endif
chunk = gst_mem_chunk_new ("GstEventChunk", sizeof (GstEvent),
sizeof (GstEvent) * 50, 0);
}
static GstEvent*
......@@ -55,7 +61,7 @@ _gst_event_copy (GstEvent *event)
{
GstEvent *copy;
copy = g_new0(GstEvent, 1);
copy = gst_mem_chunk_alloc (chunk);
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_event_trace, copy);
#endif
......@@ -83,8 +89,7 @@ _gst_event_free (GstEvent* event)
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_event_trace, event);
#endif
g_free (event);
gst_mem_chunk_free (chunk, event);
}
/**
......@@ -134,7 +139,7 @@ gst_event_new (GstEventType type)
{
GstEvent *event;
event = g_new0(GstEvent, 1);
event = gst_mem_chunk_alloc0 (chunk);
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_event_trace, event);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment