diff options
author | Edward Hervey <edward@centricular.com> | 2020-03-18 09:39:35 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2020-03-18 17:53:34 +0100 |
commit | 917dd0881c7792cd26a8b8e8133c6f717b413c95 (patch) | |
tree | 6938655df94a097c3473967f0480798403f7f2e8 /gst/gststructure.c | |
parent | 2ef0fd18626a2dbe1b998fd06bc5eeeea6583005 (diff) | |
download | gstreamer-917dd0881c7792cd26a8b8e8133c6f717b413c95.tar.gz |
gstvalue: Inline GstValueList/GstValueArray
This tries to inline as much as possible array/list and its contents
in order to avoid double allocation/freeing. This also improves the
locality of data.
The internal value is still API/ABI compatible with the *public*
GArray structure. This allows READ-ONLY backwards compatibility with
any external users that assume that the content of a list/array value
is backed by a GArray.
Diffstat (limited to 'gst/gststructure.c')
-rw-r--r-- | gst/gststructure.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/gststructure.c b/gst/gststructure.c index 42340e1b5f..a4ee28bcdf 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -1935,6 +1935,9 @@ gst_structure_value_get_generic_type (const GValue * val) || G_VALUE_TYPE (val) == GST_TYPE_ARRAY) { GArray *array = g_value_peek_pointer (val); + /* Note, we can do this because the internal + * GstValueList/GstValueArray implementation is API/ABI compatible + * with GArray */ if (array->len > 0) { GValue *value = &g_array_index (array, GValue, 0); |