mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
iterator: store size in the struct
https://bugzilla.gnome.org/show_bug.cgi?id=638987
This commit is contained in:
parent
dc63e38219
commit
47ebd0755b
2 changed files with 9 additions and 6 deletions
|
@ -71,13 +71,14 @@
|
||||||
#include "gst_private.h"
|
#include "gst_private.h"
|
||||||
#include <gst/gstiterator.h>
|
#include <gst/gstiterator.h>
|
||||||
|
|
||||||
/* FIXME 0.11: Store the size inside the iterator, use GSlice for allocation
|
/* FIXME 0.11: use GSlice for allocation and let gst_iterator_free() free
|
||||||
* and let gst_iterator_free() free the memory while the free-func only frees
|
* the memory while the free-func only frees additional resources
|
||||||
* additional resources (maybe call it finalize?).
|
* (maybe call it finalize?).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_iterator_init (GstIterator * it,
|
gst_iterator_init (GstIterator * it,
|
||||||
|
guint size,
|
||||||
GType type,
|
GType type,
|
||||||
GMutex * lock,
|
GMutex * lock,
|
||||||
guint32 * master_cookie,
|
guint32 * master_cookie,
|
||||||
|
@ -85,6 +86,7 @@ gst_iterator_init (GstIterator * it,
|
||||||
GstIteratorItemFunction item,
|
GstIteratorItemFunction item,
|
||||||
GstIteratorResyncFunction resync, GstIteratorFreeFunction free)
|
GstIteratorResyncFunction resync, GstIteratorFreeFunction free)
|
||||||
{
|
{
|
||||||
|
it->size = size;
|
||||||
it->type = type;
|
it->type = type;
|
||||||
it->lock = lock;
|
it->lock = lock;
|
||||||
it->master_cookie = master_cookie;
|
it->master_cookie = master_cookie;
|
||||||
|
@ -137,8 +139,8 @@ gst_iterator_new (guint size,
|
||||||
g_return_val_if_fail (free != NULL, NULL);
|
g_return_val_if_fail (free != NULL, NULL);
|
||||||
|
|
||||||
result = g_malloc (size);
|
result = g_malloc (size);
|
||||||
gst_iterator_init (result, type, lock, master_cookie, next, item, resync,
|
gst_iterator_init (result, size, type, lock, master_cookie, next, item,
|
||||||
free);
|
resync, free);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,9 +216,10 @@ struct _GstIterator {
|
||||||
guint32 cookie; /* cookie of the iterator */
|
guint32 cookie; /* cookie of the iterator */
|
||||||
guint32 *master_cookie; /* pointer to guint32 holding the cookie when this
|
guint32 *master_cookie; /* pointer to guint32 holding the cookie when this
|
||||||
iterator was created */
|
iterator was created */
|
||||||
|
guint size;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gpointer _gst_reserved[GST_PADDING];
|
gpointer _gst_reserved[GST_PADDING-1];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* creating iterators */
|
/* creating iterators */
|
||||||
|
|
Loading…
Reference in a new issue