From 68f8c5e090f45d9614870020119f400f758664eb Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 16 May 2005 01:49:58 +0000 Subject: [PATCH] remove GstMemChunk Original commit message from CVS: remove GstMemChunk --- ChangeLog | 16 ++++++++++++++++ gst/Makefile.am | 4 ---- gst/gstbuffer.c | 10 ++-------- gst/gstclock.c | 10 ++-------- gst/gstevent.c | 14 +++----------- tests/old/testsuite/elements/struct_i386.h | 4 ---- tests/old/testsuite/elements/struct_size.c | 3 +-- testsuite/elements/struct_i386.h | 4 ---- testsuite/elements/struct_size.c | 3 +-- 9 files changed, 25 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2ff841b00..0aff635953 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-05-16 Benjamin Otte + + * gst/gsttrashstack.[ch]: + * gst/gstmemchunk.[ch]: + remove these + * gst/Makefile.am: + * gst/gstbuffer.c: (_gst_buffer_initialize), + (gst_buffer_alloc_chunk), (gst_buffer_free_chunk): + * gst/gstclock.c: (gst_clock_entry_new), (gst_clock_id_free), + (gst_clock_class_init): + * gst/gstevent.c: (_gst_event_initialize), (_gst_event_copy), + (_gst_event_free), (gst_event_new): + * testsuite/elements/struct_i386.h: + * testsuite/elements/struct_size.c: + remove all references to GstMemChunk + 2005-05-16 Benjamin Otte * configure.ac: diff --git a/gst/Makefile.am b/gst/Makefile.am index 474636000a..c7353a47e8 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -98,7 +98,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \ $(GST_INDEX_SRC) \ gstinfo.c \ gstinterface.c \ - gstmemchunk.c \ gstpad.c \ gstchildproxy.c \ gstpipeline.c \ @@ -114,7 +113,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \ gsttaginterface.c \ gstthread.c \ $(GST_TRACE_SRC) \ - gsttrashstack.c \ gsttypefind.c \ $(GST_URI_SRC) \ gsturitype.c \ @@ -173,7 +171,6 @@ gst_headers = \ gstinfo.h \ gstinterface.h \ gstmacros.h \ - gstmemchunk.h \ gstpad.h \ gstchildproxy.h \ gstpipeline.h \ @@ -189,7 +186,6 @@ gst_headers = \ gsttaginterface.h \ gstthread.h \ gsttrace.h \ - gsttrashstack.h \ gsttypefind.h \ gsttypes.h \ gsturi.h \ diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 79015398f4..2e133cd4ec 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -25,7 +25,6 @@ #include "gstatomic_impl.h" #include "gstdata_private.h" #include "gstbuffer.h" -#include "gstmemchunk.h" #include "gstinfo.h" GType _gst_buffer_type; @@ -37,8 +36,6 @@ GType _gst_buffer_type; static GstAllocTrace *_gst_buffer_trace; #endif -static GstMemChunk *chunk; - static GstBuffer *gst_buffer_alloc_chunk (void); static void gst_buffer_free_chunk (GstBuffer * buffer); @@ -51,9 +48,6 @@ _gst_buffer_initialize (void) _gst_buffer_trace = gst_alloc_trace_register (GST_BUFFER_TRACE_NAME); #endif - chunk = gst_mem_chunk_new ("GstBufferChunk", sizeof (GstBuffer), - sizeof (GstBuffer) * 200, 0); - GST_CAT_LOG (GST_CAT_BUFFER, "Buffers are initialized now"); } @@ -177,7 +171,7 @@ gst_buffer_alloc_chunk (void) { GstBuffer *newbuf; - newbuf = gst_mem_chunk_alloc (chunk); + newbuf = g_new (GstBuffer, 1); #ifndef GST_DISABLE_TRACE gst_alloc_trace_new (_gst_buffer_trace, newbuf); #endif @@ -188,7 +182,7 @@ gst_buffer_alloc_chunk (void) static void gst_buffer_free_chunk (GstBuffer * buffer) { - gst_mem_chunk_free (chunk, GST_DATA (buffer)); + g_free (buffer); #ifndef GST_DISABLE_TRACE gst_alloc_trace_free (_gst_buffer_trace, buffer); #endif diff --git a/gst/gstclock.c b/gst/gstclock.c index 7ff7856bae..599afcb664 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -26,7 +26,6 @@ #include "gstclock.h" #include "gstinfo.h" -#include "gstmemchunk.h" #ifndef GST_DISABLE_TRACE /* #define GST_WITH_ALLOC_TRACE */ @@ -45,8 +44,6 @@ enum ARG_EVENT_DIFF }; -static GstMemChunk *_gst_clock_entries_chunk; - void gst_clock_id_unlock (GstClockID id); @@ -71,7 +68,7 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time, { GstClockEntry *entry; - entry = gst_mem_chunk_alloc (_gst_clock_entries_chunk); + entry = g_new (GstClockEntry, 1); #ifndef GST_DISABLE_TRACE gst_alloc_trace_new (_gst_clock_entry_trace, entry); #endif @@ -298,7 +295,7 @@ gst_clock_id_free (GstClockID id) #ifndef GST_DISABLE_TRACE gst_alloc_trace_free (_gst_clock_entry_trace, id); #endif - gst_mem_chunk_free (_gst_clock_entries_chunk, id); + g_free (id); } /** @@ -368,9 +365,6 @@ gst_clock_class_init (GstClockClass * klass) if (!g_thread_supported ()) g_thread_init (NULL); - _gst_clock_entries_chunk = gst_mem_chunk_new ("GstClockEntries", - sizeof (GstClockEntry), sizeof (GstClockEntry) * 32, G_ALLOC_AND_FREE); - #ifndef GST_DISABLE_TRACE _gst_clock_entry_trace = gst_alloc_trace_register (GST_CLOCK_ENTRY_TRACE_NAME); diff --git a/gst/gstevent.c b/gst/gstevent.c index 0d4a742a6f..1d4f52fecb 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -27,7 +27,6 @@ #include "gstclock.h" #include "gstinfo.h" -#include "gstmemchunk.h" #include "gstevent.h" #include "gsttag.h" @@ -37,10 +36,6 @@ static GstAllocTrace *_event_trace; #endif -static GstMemChunk *chunk; - -/* #define MEMPROF */ - GType _gst_event_type; void @@ -52,9 +47,6 @@ _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 * @@ -62,7 +54,7 @@ _gst_event_copy (GstEvent * event) { GstEvent *copy; - copy = gst_mem_chunk_alloc (chunk); + copy = g_new (GstEvent, 1); #ifndef GST_DISABLE_TRACE gst_alloc_trace_new (_event_trace, copy); #endif @@ -116,7 +108,7 @@ _gst_event_free (GstEvent * event) #ifndef GST_DISABLE_TRACE gst_alloc_trace_free (_event_trace, event); #endif - gst_mem_chunk_free (chunk, event); + g_free (event); } /** @@ -171,7 +163,7 @@ gst_event_new (GstEventType type) { GstEvent *event; - event = gst_mem_chunk_alloc0 (chunk); + event = g_new0 (GstEvent, 1); #ifndef GST_DISABLE_TRACE gst_alloc_trace_new (_event_trace, event); #endif diff --git a/tests/old/testsuite/elements/struct_i386.h b/tests/old/testsuite/elements/struct_i386.h index ec634cd47f..01624b310c 100644 --- a/tests/old/testsuite/elements/struct_i386.h +++ b/tests/old/testsuite/elements/struct_i386.h @@ -102,10 +102,6 @@ Struct list[] = { , {"GstAllocTrace", sizeof (GstAllocTrace), 16} , - {"GstTrashStack", sizeof (GstTrashStack), 12} - , - {"GstTrashStackElement", sizeof (GstTrashStackElement), 4} - , {"GstTypeFind", sizeof (GstTypeFind), 32} , {"GstTypeFindFactory", sizeof (GstTypeFindFactory), 72} diff --git a/tests/old/testsuite/elements/struct_size.c b/tests/old/testsuite/elements/struct_size.c index 1343125c02..61ffbc7374 100644 --- a/tests/old/testsuite/elements/struct_size.c +++ b/tests/old/testsuite/elements/struct_size.c @@ -5,7 +5,6 @@ #include #include -#include #include typedef struct @@ -16,7 +15,7 @@ typedef struct } Struct; -#ifdef HAVE_CPU_I386 +#if 0 #include "struct_i386.h" #define HAVE_ABI_SIZES #else diff --git a/testsuite/elements/struct_i386.h b/testsuite/elements/struct_i386.h index ec634cd47f..01624b310c 100644 --- a/testsuite/elements/struct_i386.h +++ b/testsuite/elements/struct_i386.h @@ -102,10 +102,6 @@ Struct list[] = { , {"GstAllocTrace", sizeof (GstAllocTrace), 16} , - {"GstTrashStack", sizeof (GstTrashStack), 12} - , - {"GstTrashStackElement", sizeof (GstTrashStackElement), 4} - , {"GstTypeFind", sizeof (GstTypeFind), 32} , {"GstTypeFindFactory", sizeof (GstTypeFindFactory), 72} diff --git a/testsuite/elements/struct_size.c b/testsuite/elements/struct_size.c index 1343125c02..61ffbc7374 100644 --- a/testsuite/elements/struct_size.c +++ b/testsuite/elements/struct_size.c @@ -5,7 +5,6 @@ #include #include -#include #include typedef struct @@ -16,7 +15,7 @@ typedef struct } Struct; -#ifdef HAVE_CPU_I386 +#if 0 #include "struct_i386.h" #define HAVE_ABI_SIZES #else