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:
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"
/* 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
#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);
GstCaps *
gst_caps_new_empty (void)
{
- GstCaps *caps = ALLOC_CAPS ();
+ GstCaps *caps = g_slice_new (GstCaps);
caps->type = GST_TYPE_CAPS;
caps->refcount = 1;
#ifdef DEBUG_REFCOUNT
GST_CAT_LOG (GST_CAT_CAPS, "freeing caps %p", caps);
#endif
- FREE_CAPS (caps);
+ g_slice_free (GstCaps, caps);
}
/**
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
{
GstClockEntry *entry;
- entry = ALLOC_ENTRY ();
+ entry = g_slice_new (GstClockEntry);
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_clock_entry_trace, entry);
#endif
#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_clock_entry_trace, id);
#endif
- FREE_ENTRY (id);
+ g_slice_free (GstClockEntry, id);
}
/**
{
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;
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);
}
/**
{
GstSegment *result;
- result = g_new0 (GstSegment, 1);
+ result = g_slice_new0 (GstSegment);
gst_segment_init (result, GST_FORMAT_UNDEFINED);
return result;
void
gst_segment_free (GstSegment * segment)
{
- g_free (segment);
+ g_slice_free (GstSegment, segment);
}
/**
{
GstStructure *structure;
- structure = g_new0 (GstStructure, 1);
+ structure = g_slice_new0 (GstStructure);
structure->type = gst_structure_get_type ();
structure->name = quark;
structure->fields =
#ifdef USE_POISONING
memset (structure, 0xff, sizeof (GstStructure));
#endif
- g_free (structure);
+ g_slice_free (GstStructure, structure);
}
/**