trace: make alloc trace work for miniobject again
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 27 Jan 2012 14:32:18 +0000 (15:32 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 27 Jan 2012 14:33:48 +0000 (15:33 +0100)
gst/gst.c
gst/gst_private.h
gst/gstminiobject.c

index 84b9552..f24d258 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -638,6 +638,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
   llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
   g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);
 
+  _priv_gst_mini_object_initialize ();
   _priv_gst_quarks_initialize ();
   _priv_gst_memory_initialize ();
   _priv_gst_format_initialize ();
index dd93110..2e69809 100644 (file)
@@ -94,6 +94,7 @@ gboolean _priv_gst_in_valgrind (void);
 
 /* init functions called from gst_init(). */
 void  _priv_gst_quarks_initialize (void);
+void  _priv_gst_mini_object_initialize (void);
 void  _priv_gst_buffer_initialize (void);
 void  _priv_gst_buffer_list_initialize (void);
 void  _priv_gst_structure_initialize (void);
index 78749dd..2a42b61 100644 (file)
@@ -38,8 +38,6 @@
 #include "gst/gstinfo.h"
 #include <gobject/gvaluecollector.h>
 
-#define GST_DISABLE_TRACE
-
 #ifndef GST_DISABLE_TRACE
 #include "gsttrace.h"
 static GstAllocTrace *_gst_mini_object_trace;
@@ -48,6 +46,14 @@ static GstAllocTrace *_gst_mini_object_trace;
 /* Mutex used for weak referencing */
 G_LOCK_DEFINE_STATIC (weak_refs_mutex);
 
+void
+_priv_gst_mini_object_initialize (void)
+{
+#ifndef GST_DISABLE_TRACE
+  _gst_mini_object_trace = gst_alloc_trace_register ("GstMiniObject");
+#endif
+}
+
 /**
  * gst_mini_object_init:
  * @mini_object: a #GstMiniObject 
@@ -69,6 +75,10 @@ gst_mini_object_init (GstMiniObject * mini_object, GType type, gsize size)
   mini_object->size = size;
   mini_object->n_weak_refs = 0;
   mini_object->weak_refs = NULL;
+
+#ifndef GST_DISABLE_TRACE
+  gst_alloc_trace_new (_gst_mini_object_trace, mini_object);
+#endif
 }
 
 /**