gstcheck: drop use of GSlice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-08 01:28:43 +00:00 committed by GStreamer Marge Bot
parent bda6287075
commit ba6d952cd5
3 changed files with 20 additions and 20 deletions

View file

@ -99,7 +99,7 @@ gst_check_alloc_log_filter (const gchar * log_domain, GLogLevelFlags log_level,
{
GstCheckLogFilter *filter;
filter = g_slice_new (GstCheckLogFilter);
filter = g_new (GstCheckLogFilter, 1);
filter->log_domain = g_strdup (log_domain);
filter->log_level = log_level;
filter->regex = regex;
@ -120,7 +120,7 @@ gst_check_free_log_filter (GstCheckLogFilter * filter)
g_regex_unref (filter->regex);
if (filter->destroy)
filter->destroy (filter->user_data);
g_slice_free (GstCheckLogFilter, filter);
g_free (filter);
}
@ -1271,7 +1271,7 @@ gst_check_objects_destroyed_on_unref (gpointer object_to_unref,
{
GObject *object;
GList *objs = NULL, *tmp;
DestroyedObjectStruct *destroyed = g_slice_new0 (DestroyedObjectStruct);
DestroyedObjectStruct *destroyed = g_new0 (DestroyedObjectStruct, 1);
destroyed->object = object_to_unref;
g_object_weak_ref (object_to_unref, (GWeakNotify) weak_notify, destroyed);
@ -1284,7 +1284,7 @@ gst_check_objects_destroyed_on_unref (gpointer object_to_unref,
va_start (varargs, first_object);
while (object) {
destroyed = g_slice_new0 (DestroyedObjectStruct);
destroyed = g_new0 (DestroyedObjectStruct, 1);
destroyed->object = object;
g_object_weak_ref (object, (GWeakNotify) weak_notify, destroyed);
objs = g_list_prepend (objs, destroyed);
@ -1305,7 +1305,7 @@ gst_check_objects_destroyed_on_unref (gpointer object_to_unref,
G_OBJECT_TYPE_NAME (destroyed), destroyed->object,
destroyed->object->ref_count);
}
g_slice_free (DestroyedObjectStruct, tmp->data);
g_free (tmp->data);
}
g_list_free (objs);
}

View file

@ -2898,13 +2898,13 @@ gst_harness_thread_init (GstHarnessThread * t, GDestroyNotify freefunc,
static void
gst_harness_thread_free (GstHarnessThread * t)
{
g_slice_free (GstHarnessThread, t);
g_free (t);
}
static void
gst_harness_custom_thread_free (GstHarnessCustomThread * t)
{
g_slice_free (GstHarnessCustomThread, t);
g_free (t);
}
static void
@ -2914,7 +2914,7 @@ gst_harness_push_buffer_thread_free (GstHarnessPushBufferThread * t)
gst_caps_replace (&t->caps, NULL);
if (t->notify != NULL)
t->notify (t->data);
g_slice_free (GstHarnessPushBufferThread, t);
g_free (t);
}
}
@ -2924,7 +2924,7 @@ gst_harness_push_event_thread_free (GstHarnessPushEventThread * t)
if (t != NULL) {
if (t->notify != NULL)
t->notify (t->data);
g_slice_free (GstHarnessPushEventThread, t);
g_free (t);
}
}
@ -2934,7 +2934,7 @@ gst_harness_property_thread_free (GstHarnessPropThread * t)
if (t != NULL) {
g_free (t->name);
g_value_unset (&t->value);
g_slice_free (GstHarnessPropThread, t);
g_free (t);
}
}
@ -2963,7 +2963,7 @@ gst_harness_requestpad_thread_free (GstHarnessReqPadThread * t)
gst_caps_replace (&t->caps, NULL);
gst_harness_requestpad_release_pads (t);
g_slice_free (GstHarnessReqPadThread, t);
g_free (t);
}
}
@ -3209,7 +3209,7 @@ GstHarnessThread *
gst_harness_stress_custom_start (GstHarness * h,
GFunc init, GFunc callback, gpointer data, gulong sleep)
{
GstHarnessCustomThread *t = g_slice_new0 (GstHarnessCustomThread);
GstHarnessCustomThread *t = g_new0 (GstHarnessCustomThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_custom_thread_free, h, sleep);
@ -3239,7 +3239,7 @@ gst_harness_stress_custom_start (GstHarness * h,
GstHarnessThread *
gst_harness_stress_statechange_start_full (GstHarness * h, gulong sleep)
{
GstHarnessThread *t = g_slice_new0 (GstHarnessThread);
GstHarnessThread *t = g_new0 (GstHarnessThread, 1);
gst_harness_thread_init (t,
(GDestroyNotify) gst_harness_thread_free, h, sleep);
GST_HARNESS_THREAD_START (statechange, t);
@ -3312,7 +3312,7 @@ gst_harness_stress_push_buffer_with_cb_start_full (GstHarness * h,
GstHarnessPrepareBufferFunc func, gpointer data, GDestroyNotify notify,
gulong sleep)
{
GstHarnessPushBufferThread *t = g_slice_new0 (GstHarnessPushBufferThread);
GstHarnessPushBufferThread *t = g_new0 (GstHarnessPushBufferThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_push_buffer_thread_free, h, sleep);
@ -3375,7 +3375,7 @@ gst_harness_stress_push_event_with_cb_start_full (GstHarness * h,
GstHarnessPrepareEventFunc func, gpointer data, GDestroyNotify notify,
gulong sleep)
{
GstHarnessPushEventThread *t = g_slice_new0 (GstHarnessPushEventThread);
GstHarnessPushEventThread *t = g_new0 (GstHarnessPushEventThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_push_event_thread_free, h, sleep);
@ -3436,7 +3436,7 @@ gst_harness_stress_push_upstream_event_with_cb_start_full (GstHarness * h,
GstHarnessPrepareEventFunc func, gpointer data, GDestroyNotify notify,
gulong sleep)
{
GstHarnessPushEventThread *t = g_slice_new0 (GstHarnessPushEventThread);
GstHarnessPushEventThread *t = g_new0 (GstHarnessPushEventThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_push_event_thread_free, h, sleep);
@ -3468,7 +3468,7 @@ GstHarnessThread *
gst_harness_stress_property_start_full (GstHarness * h,
const gchar * name, const GValue * value, gulong sleep)
{
GstHarnessPropThread *t = g_slice_new0 (GstHarnessPropThread);
GstHarnessPropThread *t = g_new0 (GstHarnessPropThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_property_thread_free, h, sleep);
@ -3503,7 +3503,7 @@ gst_harness_stress_requestpad_start_full (GstHarness * h,
GstPadTemplate * templ, const gchar * name, GstCaps * caps,
gboolean release, gulong sleep)
{
GstHarnessReqPadThread *t = g_slice_new0 (GstHarnessReqPadThread);
GstHarnessReqPadThread *t = g_new0 (GstHarnessReqPadThread, 1);
gst_harness_thread_init (&t->t,
(GDestroyNotify) gst_harness_requestpad_thread_free, h, sleep);

View file

@ -556,7 +556,7 @@ gst_test_clock_add_entry (GstTestClock * test_clock,
if (jitter != NULL)
*jitter = GST_CLOCK_DIFF (GST_CLOCK_ENTRY_TIME (entry), now);
ctx = g_slice_new (GstClockEntryContext);
ctx = g_new (GstClockEntryContext, 1);
ctx->clock_entry = GST_CLOCK_ENTRY (gst_clock_id_ref (entry));
ctx->time_diff = GST_CLOCK_DIFF (now, GST_CLOCK_ENTRY_TIME (entry));
@ -576,7 +576,7 @@ gst_test_clock_remove_entry (GstTestClock * test_clock, GstClockEntry * entry)
if (ctx != NULL) {
gst_clock_id_unref (ctx->clock_entry);
priv->entry_contexts = g_list_remove (priv->entry_contexts, ctx);
g_slice_free (GstClockEntryContext, ctx);
g_free (ctx);
g_cond_broadcast (&priv->entry_processed_cond);
}