mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
taskpool: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
parent
eeced74fce
commit
3261daa623
1 changed files with 5 additions and 6 deletions
|
@ -65,7 +65,7 @@ default_func (TaskData * tdata, GstTaskPool * pool)
|
||||||
|
|
||||||
func = tdata->func;
|
func = tdata->func;
|
||||||
user_data = tdata->user_data;
|
user_data = tdata->user_data;
|
||||||
g_slice_free (TaskData, tdata);
|
g_free (tdata);
|
||||||
|
|
||||||
func (user_data);
|
func (user_data);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func,
|
||||||
{
|
{
|
||||||
TaskData *tdata;
|
TaskData *tdata;
|
||||||
|
|
||||||
tdata = g_slice_new (TaskData);
|
tdata = g_new (TaskData, 1);
|
||||||
tdata->func = func;
|
tdata->func = func;
|
||||||
tdata->user_data = user_data;
|
tdata->user_data = user_data;
|
||||||
|
|
||||||
|
@ -110,10 +110,9 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func,
|
||||||
if (pool->pool)
|
if (pool->pool)
|
||||||
g_thread_pool_push (pool->pool, tdata, error);
|
g_thread_pool_push (pool->pool, tdata, error);
|
||||||
else {
|
else {
|
||||||
g_slice_free (TaskData, tdata);
|
g_free (tdata);
|
||||||
g_set_error_literal (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
|
g_set_error_literal (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
|
||||||
"No thread pool");
|
"No thread pool");
|
||||||
|
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pool);
|
GST_OBJECT_UNLOCK (pool);
|
||||||
|
|
||||||
|
@ -349,7 +348,7 @@ shared_task_data_unref (SharedTaskData * tdata)
|
||||||
if (g_atomic_int_dec_and_test (&tdata->refcount)) {
|
if (g_atomic_int_dec_and_test (&tdata->refcount)) {
|
||||||
g_mutex_clear (&tdata->done_lock);
|
g_mutex_clear (&tdata->done_lock);
|
||||||
g_cond_clear (&tdata->done_cond);
|
g_cond_clear (&tdata->done_cond);
|
||||||
g_slice_free (SharedTaskData, tdata);
|
g_free (tdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +388,7 @@ shared_push (GstTaskPool * pool, GstTaskPoolFunction func,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_slice_new (SharedTaskData);
|
ret = g_new (SharedTaskData, 1);
|
||||||
|
|
||||||
ret->done = FALSE;
|
ret->done = FALSE;
|
||||||
ret->func = func;
|
ret->func = func;
|
||||||
|
|
Loading…
Reference in a new issue