diff --git a/subprojects/gstreamer/tests/examples/memory/my-memory.c b/subprojects/gstreamer/tests/examples/memory/my-memory.c index 2c1b7cb097..07d61d6f09 100644 --- a/subprojects/gstreamer/tests/examples/memory/my-memory.c +++ b/subprojects/gstreamer/tests/examples/memory/my-memory.c @@ -36,7 +36,7 @@ _my_alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params) GST_DEBUG ("alloc from allocator %p", allocator); - mem = g_slice_new (MyMemory); + mem = g_new (MyMemory, 1); gst_memory_init (GST_MEMORY_CAST (mem), params->flags, allocator, NULL, maxsize, params->align, params->prefix, size); @@ -52,7 +52,7 @@ _my_free (GstAllocator * allocator, GstMemory * mem) MyMemory *mmem = (MyMemory *) mem; g_free (mmem->data); - g_slice_free (MyMemory, mmem); + g_free (mmem); GST_DEBUG ("%p: freed", mmem); } @@ -101,7 +101,7 @@ _my_mem_share (MyMemory * mem, gssize offset, gsize size) if (size == -1) size = mem->mem.size - offset; - sub = g_slice_new (MyMemory); + sub = g_new (MyMemory, 1); /* the shared memory is always readonly */ gst_memory_init (GST_MEMORY_CAST (sub), GST_MINI_OBJECT_FLAGS (parent) | GST_MINI_OBJECT_FLAG_LOCK_READONLY, mem->mem.allocator, parent, diff --git a/subprojects/gstreamer/tests/examples/memory/my-vidmem.c b/subprojects/gstreamer/tests/examples/memory/my-vidmem.c index 1303a67141..9f7424592f 100644 --- a/subprojects/gstreamer/tests/examples/memory/my-vidmem.c +++ b/subprojects/gstreamer/tests/examples/memory/my-vidmem.c @@ -47,7 +47,7 @@ _my_free (GstAllocator * allocator, GstMemory * mem) MyVidmem *vmem = (MyVidmem *) mem; g_free (vmem->data); - g_slice_free (MyVidmem, vmem); + g_free (vmem); GST_DEBUG ("%p: freed", vmem); } @@ -96,7 +96,7 @@ _my_vidmem_share (MyVidmem * mem, gssize offset, gsize size) if (size == -1) size = mem->mem.size - offset; - sub = g_slice_new (MyVidmem); + sub = g_new (MyVidmem, 1); /* the shared memory is always readonly */ gst_memory_init (GST_MEMORY_CAST (sub), GST_MINI_OBJECT_FLAGS (parent) | GST_MINI_OBJECT_FLAG_LOCK_READONLY, mem->mem.allocator, parent, @@ -161,7 +161,7 @@ my_vidmem_alloc (guint format, guint width, guint height) maxsize = (GST_ROUND_UP_4 (width) * height); - mem = g_slice_new (MyVidmem); + mem = g_new (MyVidmem, 1); gst_memory_init (GST_MEMORY_CAST (mem), 0, _my_allocator, NULL, maxsize, 31, 0, maxsize); diff --git a/subprojects/gstreamer/tests/examples/streams/testrtpool.c b/subprojects/gstreamer/tests/examples/streams/testrtpool.c index 0a29fda9a0..40bdcf620c 100644 --- a/subprojects/gstreamer/tests/examples/streams/testrtpool.c +++ b/subprojects/gstreamer/tests/examples/streams/testrtpool.c @@ -55,7 +55,7 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func, gpointer data, g_message ("pushing Realtime pool %p, %p", pool, func); - tid = g_slice_new0 (TestRTId); + tid = g_new0 (TestRTId, 1); g_message ("set policy"); pthread_attr_init (&attr); @@ -77,7 +77,7 @@ default_push (GstTaskPool * pool, GstTaskPoolFunction func, gpointer data, if (res != 0) { g_set_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN, "Error creating thread: %s", g_strerror (res)); - g_slice_free (TestRTId, tid); + g_free (tid); tid = NULL; } @@ -93,7 +93,7 @@ default_join (GstTaskPool * pool, gpointer id) pthread_join (tid->thread, NULL); - g_slice_free (TestRTId, tid); + g_free (tid); } static void