mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
shm: drop use of GSlice allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3784>
This commit is contained in:
parent
3f94d7ec37
commit
35405de344
3 changed files with 14 additions and 14 deletions
|
@ -175,7 +175,7 @@ gst_shm_sink_allocator_free (GstAllocator * allocator, GstMemory * mem)
|
|||
}
|
||||
gst_object_unref (mem->allocator);
|
||||
|
||||
g_slice_free (GstShmSinkMemory, mymem);
|
||||
g_free (mymem);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
@ -206,7 +206,7 @@ gst_shm_sink_allocator_mem_share (GstMemory * mem, gssize offset, gssize size)
|
|||
if (size == -1)
|
||||
size = mem->size - offset;
|
||||
|
||||
mysub = g_slice_new0 (GstShmSinkMemory);
|
||||
mysub = g_new0 (GstShmSinkMemory, 1);
|
||||
/* the shared memory is always readonly */
|
||||
gst_memory_init (GST_MEMORY_CAST (mysub), GST_MINI_OBJECT_FLAGS (parent) |
|
||||
GST_MINI_OBJECT_FLAG_LOCK_READONLY, gst_object_ref (mem->allocator),
|
||||
|
@ -271,7 +271,7 @@ gst_shm_sink_allocator_alloc_locked (GstShmSinkAllocator * self, gsize size,
|
|||
"Allocated block %p with %" G_GSIZE_FORMAT " bytes at %p", block, size,
|
||||
sp_writer_block_get_buf (block));
|
||||
|
||||
mymem = g_slice_new0 (GstShmSinkMemory);
|
||||
mymem = g_new0 (GstShmSinkMemory, 1);
|
||||
memory = GST_MEMORY_CAST (mymem);
|
||||
mymem->data = sp_writer_block_get_buf (block);
|
||||
mymem->sink = gst_object_ref (self->sink);
|
||||
|
@ -630,7 +630,7 @@ gst_shm_sink_stop (GstBaseSink * bsink)
|
|||
(sp_buffer_free_callback) gst_buffer_unref, NULL);
|
||||
g_signal_emit (self, signals[SIGNAL_CLIENT_DISCONNECTED], 0,
|
||||
client->pollfd.fd);
|
||||
g_slice_free (struct GstShmClient, client);
|
||||
g_free (client);
|
||||
}
|
||||
|
||||
gst_poll_free (self->poll);
|
||||
|
@ -877,7 +877,7 @@ pollthread_func (gpointer data)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
gclient = g_slice_new (struct GstShmClient);
|
||||
gclient = g_new (struct GstShmClient, 1);
|
||||
gclient->client = client;
|
||||
gst_poll_fd_init (&gclient->pollfd);
|
||||
gclient->pollfd.fd = sp_writer_get_client_fd (client);
|
||||
|
@ -943,7 +943,7 @@ pollthread_func (gpointer data)
|
|||
|
||||
g_signal_emit (self, signals[SIGNAL_CLIENT_DISCONNECTED], 0,
|
||||
gclient->pollfd.fd);
|
||||
g_slice_free (struct GstShmClient, gclient);
|
||||
g_free (gclient);
|
||||
|
||||
goto again;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ gst_shm_src_start_reading (GstShmSrc * self)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gstpipe = g_slice_new0 (GstShmPipe);
|
||||
gstpipe = g_new0 (GstShmPipe, 1);
|
||||
gstpipe->use_count = 1;
|
||||
gstpipe->src = gst_object_ref (self);
|
||||
|
||||
|
@ -316,7 +316,7 @@ free_buffer (gpointer data)
|
|||
|
||||
gst_shm_pipe_dec (gsb->pipe);
|
||||
|
||||
g_slice_free (struct GstShmBuffer, gsb);
|
||||
g_free (gsb);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
@ -380,7 +380,7 @@ gst_shm_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
|
||||
GST_LOG_OBJECT (self, "Got buffer %p of size %d", buf, rv);
|
||||
|
||||
gsb = g_slice_new0 (struct GstShmBuffer);
|
||||
gsb = g_new0 (struct GstShmBuffer, 1);
|
||||
gsb->buf = buf;
|
||||
gsb->pipe = pipe;
|
||||
|
||||
|
@ -476,5 +476,5 @@ gst_shm_pipe_dec (GstShmPipe * pipe)
|
|||
GST_OBJECT_UNLOCK (pipe->src);
|
||||
|
||||
gst_object_unref (pipe->src);
|
||||
g_slice_free (GstShmPipe, pipe);
|
||||
g_free (pipe);
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
#ifdef SHM_PIPE_USE_GLIB
|
||||
#include <glib.h>
|
||||
|
||||
#define spalloc_new(type) g_slice_new (type)
|
||||
#define spalloc_alloc(size) g_slice_alloc (size)
|
||||
#define spalloc_new(type) g_new (type,1)
|
||||
#define spalloc_alloc(size) g_malloc (size)
|
||||
|
||||
#define spalloc_free(type, buf) g_slice_free (type, buf)
|
||||
#define spalloc_free1(size, buf) g_slice_free1 (size, buf)
|
||||
#define spalloc_free(type, buf) g_free (buf)
|
||||
#define spalloc_free1(size, buf) g_free (buf)
|
||||
|
||||
#else
|
||||
|
||||
|
|
Loading…
Reference in a new issue