configure.ac: Require GLib 2.12.
authorSebastian Dröge <slomo@circular-chaos.org>
Tue, 1 Apr 2008 13:55:20 +0000 (13:55 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 1 Apr 2008 13:55:20 +0000 (13:55 +0000)
Original commit message from CVS:
* configure.ac:
Require GLib 2.12.
* gst/glib-compat-private.h:
* gst/gstcaps.c: (gst_caps_new_empty), (_gst_caps_free):
* gst/gstclock.c: (gst_clock_entry_new), (_gst_clock_id_free):
Unconditionally use GSlice for allocation.
* gst/gstpoll.c: (gst_poll_new), (gst_poll_free):
* gst/gstsegment.c: (gst_segment_new), (gst_segment_free):
* gst/gststructure.c: (gst_structure_id_empty_new_with_size),
(gst_structure_free):
Use GSlice for allocation.

ChangeLog
configure.ac
gst/glib-compat-private.h
gst/gstcaps.c
gst/gstclock.c
gst/gstpoll.c
gst/gstsegment.c
gst/gststructure.c

index 55718c0..9d2a4f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2008-04-01  Sebastian Dröge  <slomo@circular-chaos.org>
 
+       * configure.ac:
+       Require GLib 2.12.
+
+       * gst/glib-compat-private.h:
+       * gst/gstcaps.c: (gst_caps_new_empty), (_gst_caps_free):
+       * gst/gstclock.c: (gst_clock_entry_new), (_gst_clock_id_free):
+       Unconditionally use GSlice for allocation.
+
+       * gst/gstpoll.c: (gst_poll_new), (gst_poll_free):
+       * gst/gstsegment.c: (gst_segment_new), (gst_segment_free):
+       * gst/gststructure.c: (gst_structure_id_empty_new_with_size),
+       (gst_structure_free):
+       Use GSlice for allocation.
+
+2008-04-01  Sebastian Dröge  <slomo@circular-chaos.org>
+
        * gst/parse/Makefile.am:
        * gst/parse/grammar.tab.pre.c:
        * gst/parse/grammar.tab.pre.h:
index 8869be6..3f356a0 100644 (file)
@@ -471,8 +471,9 @@ LIBS="$save_libs"
 dnl *** checks for dependency libraries ***
 
 dnl GLib
+GLIB_REQ=2.12
 
-AG_GST_GLIB_CHECK([2.8])
+AG_GST_GLIB_CHECK([$GLIB_REQ])
 
 dnl FIXME: 0.11: Guess we need to keep this around until 0.11
 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
index 2b9a963..75e7108 100644 (file)
@@ -14,9 +14,4 @@ G_BEGIN_DECLS
 
 /* adaptations */
 
-/* FIXME: remove once we depend on GLib 2.10 */
-#if (!GLIB_CHECK_VERSION (2, 10, 0))
-#define g_intern_string(s) g_quark_to_string(g_quark_from_string(s))
-#endif
-
 G_END_DECLS
index 501530c..3d2fd60 100644 (file)
 #define IS_WRITABLE(caps) \
   (g_atomic_int_get (&(caps)->refcount) == 1)
 
-#if GLIB_CHECK_VERSION (2, 10, 0)
-#define ALLOC_CAPS()    g_slice_new (GstCaps)
-#define FREE_CAPS(caps) g_slice_free (GstCaps, caps)
-#else
-#define ALLOC_CAPS()    g_new (GstCaps, 1)
-#define FREE_CAPS(caps) g_free (caps)
-#endif
-
 /* lock to protect multiple invocations of static caps to caps conversion */
 G_LOCK_DEFINE_STATIC (static_caps_lock);
 
@@ -139,7 +131,7 @@ gst_caps_get_type (void)
 GstCaps *
 gst_caps_new_empty (void)
 {
-  GstCaps *caps = ALLOC_CAPS ();
+  GstCaps *caps = g_slice_new (GstCaps);
 
   caps->type = GST_TYPE_CAPS;
   caps->refcount = 1;
@@ -309,7 +301,7 @@ _gst_caps_free (GstCaps * caps)
 #ifdef DEBUG_REFCOUNT
   GST_CAT_LOG (GST_CAT_CAPS, "freeing caps %p", caps);
 #endif
-  FREE_CAPS (caps);
+  g_slice_free (GstCaps, caps);
 }
 
 /**
index 7a9789e..0e497a5 100644 (file)
 static GstAllocTrace *_gst_clock_entry_trace;
 #endif
 
-#if GLIB_CHECK_VERSION (2, 10, 0)
-#define ALLOC_ENTRY()     g_slice_new (GstClockEntry)
-#define FREE_ENTRY(entry) g_slice_free (GstClockEntry, entry)
-#else
-#define ALLOC_ENTRY()     g_new (GstClockEntry, 1)
-#define FREE_ENTRY(entry) g_free (entry)
-#endif
-
 /* #define DEBUGGING_ENABLED */
 
 #define DEFAULT_STATS                   FALSE
@@ -162,7 +154,7 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time,
 {
   GstClockEntry *entry;
 
-  entry = ALLOC_ENTRY ();
+  entry = g_slice_new (GstClockEntry);
 #ifndef GST_DISABLE_TRACE
   gst_alloc_trace_new (_gst_clock_entry_trace, entry);
 #endif
@@ -211,7 +203,7 @@ _gst_clock_id_free (GstClockID id)
 #ifndef GST_DISABLE_TRACE
   gst_alloc_trace_free (_gst_clock_entry_trace, id);
 #endif
-  FREE_ENTRY (id);
+  g_slice_free (GstClockEntry, id);
 }
 
 /**
index b58e403..658fcf6 100644 (file)
@@ -462,7 +462,7 @@ gst_poll_new (gboolean controllable)
 {
   GstPoll *nset;
 
-  nset = g_new0 (GstPoll, 1);
+  nset = g_slice_new0 (GstPoll);
   nset->lock = g_mutex_new ();
 #ifndef G_OS_WIN32
   nset->mode = GST_POLL_MODE_AUTO;
@@ -530,7 +530,7 @@ gst_poll_free (GstPoll * set)
   g_array_free (set->active_fds, TRUE);
   g_array_free (set->fds, TRUE);
   g_mutex_free (set->lock);
-  g_free (set);
+  g_slice_free (GstPoll, set);
 }
 
 /**
index eef0a48..dd589a4 100644 (file)
@@ -121,7 +121,7 @@ gst_segment_new (void)
 {
   GstSegment *result;
 
-  result = g_new0 (GstSegment, 1);
+  result = g_slice_new0 (GstSegment);
   gst_segment_init (result, GST_FORMAT_UNDEFINED);
 
   return result;
@@ -136,7 +136,7 @@ gst_segment_new (void)
 void
 gst_segment_free (GstSegment * segment)
 {
-  g_free (segment);
+  g_slice_free (GstSegment, segment);
 }
 
 /**
index 18c816e..673947c 100644 (file)
@@ -113,7 +113,7 @@ gst_structure_id_empty_new_with_size (GQuark quark, guint prealloc)
 {
   GstStructure *structure;
 
-  structure = g_new0 (GstStructure, 1);
+  structure = g_slice_new0 (GstStructure);
   structure->type = gst_structure_get_type ();
   structure->name = quark;
   structure->fields =
@@ -330,7 +330,7 @@ gst_structure_free (GstStructure * structure)
 #ifdef USE_POISONING
   memset (structure, 0xff, sizeof (GstStructure));
 #endif
-  g_free (structure);
+  g_slice_free (GstStructure, structure);
 }
 
 /**