/**
* gst_trace_read_tsc:
- * @dst: pointer to hold the result.
+ * @dst: (out) pointer to hold the result.
*
* Read a platform independent timer value that can be used in
* benchmarks.
* @filename: a filename
* @size: the max size of the file
*
- * Create a ringbuffer of @size in the file with @filename to
+ * Create a ringbuffer of @size in the file with @filename to
* store trace results in.
*
- * Returns: a new #GstTrace.
+ * Free-function: gst_trace_destroy
+ *
+ * Returns: (transfer full): a new #GstTrace.
*/
GstTrace *
gst_trace_new (const gchar * filename, gint size)
{
- GstTrace *trace = g_malloc (sizeof (GstTrace));
+ GstTrace *trace = g_slice_new (GstTrace);
g_return_val_if_fail (trace != NULL, NULL);
trace->filename = g_strdup (filename);
/**
* gst_trace_destroy:
- * @trace: the #GstTrace to destroy
+ * @trace: (in) (transfer full): the #GstTrace to destroy
*
* Flush an close the previously allocated @trace.
*/
gst_trace_flush (trace);
close (trace->fd);
g_free (trace->buf);
- g_free (trace);
+ g_slice_free (GstTrace, trace);
}
/**
* gst_trace_text_flush:
* @trace: the #GstTrace to flush.
*
- * Flush any pending trace entries in @trace to the trace file,
+ * Flush any pending trace entries in @trace to the trace file,
* formatted as a text line with timestamp and sequence numbers.
* @trace can be NULL in which case the default #GstTrace will be
* flushed.
entry->sequence = seq;
entry->data = data;
strncpy (entry->message, msg, 112);
+ entry->message[111] = '\0';
trace->bufoffset++;
gst_trace_flush (trace);
g_return_val_if_fail (name, NULL);
- trace = g_new0 (GstAllocTrace, 1);
+ trace = g_slice_new (GstAllocTrace);
trace->name = g_strdup (name);
trace->live = 0;
trace->mem_live = NULL;