From fd43b3d6048427746ab2f9b663a62599de948506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 8 Jan 2023 16:03:16 +0000 Subject: [PATCH] ximage, xvimage: drop use of GSlice Part-of: --- subprojects/gst-plugins-base/sys/ximage/ximagepool.c | 8 ++++---- subprojects/gst-plugins-base/sys/xvimage/xvcontext.c | 10 +++++----- .../gst-plugins-base/sys/xvimage/xvimageallocator.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/subprojects/gst-plugins-base/sys/ximage/ximagepool.c b/subprojects/gst-plugins-base/sys/ximage/ximagepool.c index 4d3871d1b6..231e56c8df 100644 --- a/subprojects/gst-plugins-base/sys/ximage/ximagepool.c +++ b/subprojects/gst-plugins-base/sys/ximage/ximagepool.c @@ -116,7 +116,7 @@ beach: gst_object_unref (mem->sink); sub_mem: - g_slice_free (GstXImageMemory, mem); + g_free (mem); } static gpointer @@ -151,7 +151,7 @@ ximage_memory_share (GstXImageMemory * mem, gssize offset, gsize size) size = mem->parent.size - offset; /* the shared memory is always readonly */ - sub = g_slice_new (GstXImageMemory); + sub = g_new (GstXImageMemory, 1); gst_memory_init (GST_MEMORY_CAST (sub), GST_MINI_OBJECT_FLAGS (parent) | GST_MINI_OBJECT_FLAG_LOCK_READONLY, mem->parent.allocator, @@ -222,7 +222,7 @@ ximage_memory_alloc (GstXImageBufferPool * xpool) width = xpool->padded_width; height = xpool->padded_height; - mem = g_slice_new (GstXImageMemory); + mem = g_new (GstXImageMemory, 1); #ifdef HAVE_XSHM mem->SHMInfo.shmaddr = ((void *) -1); @@ -360,7 +360,7 @@ ximage_memory_alloc (GstXImageBufferPool * xpool) beach: if (!success) { - g_slice_free (GstXImageMemory, mem); + g_free (mem); mem = NULL; } diff --git a/subprojects/gst-plugins-base/sys/xvimage/xvcontext.c b/subprojects/gst-plugins-base/sys/xvimage/xvcontext.c index 75bebd9887..8574a88ce3 100644 --- a/subprojects/gst-plugins-base/sys/xvimage/xvcontext.c +++ b/subprojects/gst-plugins-base/sys/xvimage/xvcontext.c @@ -630,7 +630,7 @@ gst_xvcontext_free (GstXvContext * context) g_mutex_clear (&context->lock); - g_slice_free1 (sizeof (GstXvContext), context); + g_free (context); } @@ -659,7 +659,7 @@ gst_xvcontext_new (GstXvContextConfig * config, GError ** error) g_return_val_if_fail (config != NULL, NULL); - context = g_slice_new0 (GstXvContext); + context = g_new0 (GstXvContext, 1); gst_mini_object_init (GST_MINI_OBJECT_CAST (context), 0, gst_xvcontext_get_type (), @@ -989,7 +989,7 @@ gst_xvcontext_create_xwindow (GstXvContext * context, gint width, gint height) g_return_val_if_fail (GST_IS_XVCONTEXT (context), NULL); - window = g_slice_new0 (GstXWindow); + window = g_new0 (GstXWindow, 1); window->context = gst_xvcontext_ref (context); window->render_rect.x = window->render_rect.y = 0; @@ -1064,7 +1064,7 @@ gst_xvcontext_create_xwindow_from_xid (GstXvContext * context, XID xid) GstXWindow *window; XWindowAttributes attr; - window = g_slice_new0 (GstXWindow); + window = g_new0 (GstXWindow, 1); window->win = xid; window->context = gst_xvcontext_ref (context); @@ -1124,7 +1124,7 @@ gst_xwindow_destroy (GstXWindow * window) gst_xvcontext_unref (context); - g_slice_free1 (sizeof (GstXWindow), window); + g_free (window); } #ifdef HAVE_XI2 diff --git a/subprojects/gst-plugins-base/sys/xvimage/xvimageallocator.c b/subprojects/gst-plugins-base/sys/xvimage/xvimageallocator.c index a6d84325b8..2107d3069c 100644 --- a/subprojects/gst-plugins-base/sys/xvimage/xvimageallocator.c +++ b/subprojects/gst-plugins-base/sys/xvimage/xvimageallocator.c @@ -185,7 +185,7 @@ gst_xvimage_allocator_free (GstAllocator * allocator, GstMemory * gmem) g_mutex_unlock (&context->lock); sub_mem: - g_slice_free (GstXvImageMemory, mem); + g_free (mem); } static gpointer @@ -223,7 +223,7 @@ gst_xvimage_memory_share (GstXvImageMemory * mem, gssize offset, gsize size) size = mem->parent.size - offset; /* the shared memory is always readonly */ - sub = g_slice_new (GstXvImageMemory); + sub = g_new (GstXvImageMemory, 1); gst_memory_init (GST_MEMORY_CAST (sub), GST_MINI_OBJECT_FLAGS (parent) | GST_MINI_OBJECT_FLAG_LOCK_READONLY, mem->parent.allocator, @@ -357,7 +357,7 @@ gst_xvimage_allocator_alloc (GstXvImageAllocator * allocator, gint im_format, context = allocator->context; - mem = g_slice_new (GstXvImageMemory); + mem = g_new (GstXvImageMemory, 1); mem->im_format = im_format; mem->info = *info; @@ -531,7 +531,7 @@ gst_xvimage_allocator_alloc (GstXvImageAllocator * allocator, gint im_format, beach: if (!success) { - g_slice_free (GstXvImageMemory, mem); + g_free (mem); mem = NULL; }