diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2003-05-10 12:15:58 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2003-05-10 12:15:58 +0000 |
commit | b41c935ff72e44785794b44ba0d400103ad1c904 (patch) | |
tree | f2481a1e1089aea0f18107ab4d3ab8c11cccc1eb | |
parent | 76b9ffbdbc1641a403cf8cf762dde3959136bcf3 (diff) |
Use GstMemChunk to allocate events
Original commit message from CVS:
Use GstMemChunk to allocate events
-rw-r--r-- | gst/gstevent.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c index ecf145c91..2c6d58000 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -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 |