registrychunks: get rid of internal GST_REGISTRY_CHUNK_FLAG_MALLOC

Not actually needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-07 19:27:30 +00:00 committed by GStreamer Marge Bot
parent ade83c8355
commit 9e71898337
2 changed files with 3 additions and 8 deletions

View file

@ -116,10 +116,7 @@ void
_priv_gst_registry_chunk_free (GstRegistryChunk * chunk)
{
if (!(chunk->flags & GST_REGISTRY_CHUNK_FLAG_CONST)) {
if ((chunk->flags & GST_REGISTRY_CHUNK_FLAG_MALLOC))
g_free (chunk->data);
else
g_free (chunk->data);
g_free (chunk->data);
}
g_free (chunk);
}
@ -165,7 +162,7 @@ gst_registry_chunks_save_string (GList ** list, gchar * str)
chunk = g_new (GstRegistryChunk, 1);
chunk->data = str;
chunk->size = strlen ((gchar *) chunk->data) + 1;
chunk->flags = GST_REGISTRY_CHUNK_FLAG_MALLOC;
chunk->flags = GST_REGISTRY_CHUNK_FLAG_NONE;
chunk->align = FALSE;
*list = g_list_prepend (*list, chunk);
return TRUE;

View file

@ -28,13 +28,11 @@
/*
* we reference strings directly from the plugins and in this case set CONST to
* avoid freeing them. If g_free() should be used, the MALLOC flag is set,
* otherwise g_free() will also be used. (FIXME: don't need MALLOC flag any more)
* avoid freeing them.
*/
enum {
GST_REGISTRY_CHUNK_FLAG_NONE = 0,
GST_REGISTRY_CHUNK_FLAG_CONST = 1,
GST_REGISTRY_CHUNK_FLAG_MALLOC = 2,
};
/*