+/**
+ * gst_alloc_trace_new:
+ * @trace: The tracer to use
+ * @mem: The memory allocated
+ *
+ * Use the tracer to trace a new memory allocation
+ */
+#define _gst_alloc_trace_new(trace, mem) \
+G_STMT_START { \
+ if (G_UNLIKELY ((trace)->flags)) { \
+ g_mutex_lock (&_gst_trace_mutex); \
+ if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \
+ (trace)->live++; \
+ if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \
+ (trace)->mem_live = \
+ g_slist_prepend ((trace)->mem_live, mem); \
+ g_mutex_unlock (&_gst_trace_mutex); \
+ } \
+} G_STMT_END
+
+/**
+ * gst_alloc_trace_free:
+ * @trace: The tracer to use
+ * @mem: The memory that is freed
+ *
+ * Trace a memory free operation
+ */
+#define _gst_alloc_trace_free(trace, mem) \
+G_STMT_START { \
+ if (G_UNLIKELY ((trace)->flags)) { \
+ g_mutex_lock (&_gst_trace_mutex); \
+ if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \
+ (trace)->live--; \
+ if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \
+ (trace)->mem_live = \
+ g_slist_remove ((trace)->mem_live, mem); \
+ g_mutex_unlock (&_gst_trace_mutex); \
+ } \
+} G_STMT_END