miniobject: Remove confusing DEBUG_REFCOUNT define

the debugging statements will be silenced automatically if debugging
is disabled, and the type check is actually required.
This commit is contained in:
Edward Hervey 2010-10-11 18:30:54 +02:00
parent 62ffd66f10
commit 89d3da6cba

View file

@ -43,8 +43,6 @@
static GstAllocTrace *_gst_mini_object_trace;
#endif
#define DEBUG_REFCOUNT
#if 0
static void gst_mini_object_base_init (gpointer g_class);
static void gst_mini_object_base_finalize (gpointer g_class);
@ -307,13 +305,11 @@ gst_mini_object_ref (GstMiniObject * mini_object)
* the object
g_return_val_if_fail (mini_object->refcount > 0, NULL);
*/
#ifdef DEBUG_REFCOUNT
g_return_val_if_fail (GST_IS_MINI_OBJECT (mini_object), NULL);
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p ref %d->%d", mini_object,
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object),
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) + 1);
#endif
g_atomic_int_inc (&mini_object->refcount);
@ -353,17 +349,13 @@ gst_mini_object_free (GstMiniObject * mini_object)
void
gst_mini_object_unref (GstMiniObject * mini_object)
{
g_return_if_fail (mini_object != NULL);
g_return_if_fail (mini_object->refcount > 0);
#ifdef DEBUG_REFCOUNT
g_return_if_fail (GST_IS_MINI_OBJECT (mini_object));
g_return_if_fail (mini_object->refcount > 0);
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p unref %d->%d",
mini_object,
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object),
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) - 1);
#endif
if (G_UNLIKELY (g_atomic_int_dec_and_test (&mini_object->refcount))) {
gst_mini_object_free (mini_object);
@ -386,11 +378,9 @@ gst_mini_object_replace (GstMiniObject ** olddata, GstMiniObject * newdata)
g_return_if_fail (olddata != NULL);
#ifdef DEBUG_REFCOUNT
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "replace %p (%d) with %p (%d)",
*olddata, *olddata ? (*olddata)->refcount : 0,
newdata, newdata ? newdata->refcount : 0);
#endif
olddata_val = g_atomic_pointer_get ((gpointer *) olddata);