GNOME Bugzilla – Bug 750149
queuearray: allow storing of structs in addition to pointers (for GQueue optimisation)
Last modified: 2015-08-16 13:36:36 UTC
Created attachment 304310 [details] [review] queuearray: allow storing of structs in addition to pointers This way we don't have to allocate/free temporary structs for storing things in the queue array.
Created attachment 304311 [details] [review] queue: avoid slice allocs/frees for each item Let GstQueueArray store our item struct. That way we don't have to alloc/free temporary QueueItem slices for every item we want to store in the queue.
We could possibly also re-use most of the old functions and just interpret the gpointer data pointer differently if the QueueArray was created for a struct, then we only need the new _new() function and the drop_struct() one (or not even that, since GstQueue doesn't need _drop). That's not very nice though IMHO.
commit 41fdf21a60ca69bdc90bef367fbce41dcf4415ad Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat May 30 14:27:05 2015 +0100 queue: avoid slice allocs/frees for each item Microoptimisation: Let GstQueueArray store our item struct. That way we don't have to alloc/free temporary QueueItem slices for every item we want to put into the queue. https://bugzilla.gnome.org/show_bug.cgi?id=750149 commit d0f85838ab789f8b0e0075c1818eca8d35d43133 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat May 30 13:07:50 2015 +0100 queuearray: allow storing of structs in addition to pointers This way we don't have to allocate/free temporary structs for storing things in the queue array. API: gst_queue_array_new_for_struct() API: gst_queue_array_push_tail_struct() API: gst_queue_array_peek_head_struct() API: gst_queue_array_pop_head_struct() API: gst_queue_array_drop_struct() https://bugzilla.gnome.org/show_bug.cgi?id=750149