core: tests: drop use of GSlice allocator

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-04 17:58:13 +00:00 committed by GStreamer Marge Bot
parent 6bdef53683
commit d5d25c0f7a
3 changed files with 5 additions and 4 deletions

View file

@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA.
*/
#include "../../gst/gst_private.h"
#include "../../gst/glib-compat-private.h"
#include <gst/check/gstcheck.h>

View file

@ -588,7 +588,7 @@ static GstMemory *
_my_opaque_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params)
{
MyOpaqueMemory *mem = g_slice_new (MyOpaqueMemory);
MyOpaqueMemory *mem = g_new (MyOpaqueMemory, 1);
gsize maxsize = size + params->prefix + params->padding;
gst_memory_init (GST_MEMORY_CAST (mem), params->flags, allocator, NULL,
@ -605,7 +605,7 @@ _my_opaque_free (GstAllocator * allocator, GstMemory * mem)
MyOpaqueMemory *mmem = (MyOpaqueMemory *) mem;
g_free (mmem->data);
g_slice_free (MyOpaqueMemory, mmem);
g_free (mmem);
}
static gpointer

View file

@ -116,7 +116,7 @@ gst_test_util_wait_for_clock_id_begin (GstTestClock * test_clock, GstClockID id,
{
GtuClockWaitContext *wait_ctx;
wait_ctx = g_slice_new (GtuClockWaitContext);
wait_ctx = g_new (GtuClockWaitContext, 1);
wait_ctx->test_clock = gst_object_ref (test_clock);
wait_ctx->reference = gst_clock_get_time (GST_CLOCK (wait_ctx->test_clock));
wait_ctx->id = gst_clock_id_ref (id);
@ -179,7 +179,7 @@ gst_test_util_wait_for_clock_id_end (GtuClockWaitContext * wait_ctx)
gst_clock_id_unref (wait_ctx->id);
gst_object_unref (wait_ctx->test_clock);
g_slice_free (GtuClockWaitContext, wait_ctx);
g_free (wait_ctx);
return status;
}