ges: drop use of GSlice allocator

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3784>
This commit is contained in:
Tim-Philipp Müller 2023-01-24 20:22:28 +00:00 committed by GStreamer Marge Bot
parent f8817a8e8d
commit 18a3c32323
11 changed files with 33 additions and 33 deletions

View file

@ -610,7 +610,7 @@ _free_entries (gpointer entry)
GESAssetCacheEntry *data = (GESAssetCacheEntry *) entry;
if (data->asset)
gst_object_unref (data->asset);
g_slice_free (GESAssetCacheEntry, entry);
g_free (entry);
}
static void
@ -740,7 +740,7 @@ ges_asset_cache_put (GESAsset * asset, GTask * task)
g_strdup (_extractable_type_name (extractable_type)), entries_table);
}
entry = g_slice_new0 (GESAssetCacheEntry);
entry = g_new0 (GESAssetCacheEntry, 1);
/* transfer asset to entry */
entry->asset = asset;

View file

@ -124,7 +124,7 @@ static void
_free_layer_entry (LayerEntry * entry)
{
gst_object_unref (entry->layer);
g_slice_free (LayerEntry, entry);
g_free (entry);
}
static void
@ -133,7 +133,7 @@ _free_pending_group (PendingGroup * pgroup)
if (pgroup->group)
g_object_unref (pgroup->group);
g_list_free_full (pgroup->pending_children, g_free);
g_slice_free (PendingGroup, pgroup);
g_free (pgroup);
}
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GESBaseXmlFormatter,
@ -663,7 +663,7 @@ _free_pending_asset (GESBaseXmlFormatterPrivate * priv, PendingAsset * passet)
gst_structure_free (passet->properties);
priv->pending_assets = g_list_remove (priv->pending_assets, passet);
g_slice_free (PendingAsset, passet);
g_free (passet);
}
static void
@ -842,7 +842,7 @@ ges_base_xml_formatter_add_asset (GESBaseXmlFormatter * self,
return;
}
passet = g_slice_new0 (PendingAsset);
passet = g_new0 (PendingAsset, 1);
passet->metadatas = g_strdup (metadatas);
passet->id = g_strdup (id);
passet->extractable_type = extractable_type;
@ -1005,7 +1005,7 @@ ges_base_xml_formatter_add_layer (GESBaseXmlFormatter * self,
g_list_free (tracks);
}
entry = g_slice_new0 (LayerEntry);
entry = g_new0 (LayerEntry, 1);
entry->layer = gst_object_ref (layer);
entry->auto_trans = auto_transition;
@ -1292,7 +1292,7 @@ ges_base_xml_formatter_add_group (GESBaseXmlFormatter * self,
return;
}
pgroup = g_slice_new0 (PendingGroup);
pgroup = g_new0 (PendingGroup, 1);
pgroup->group = ges_group_new ();
if (metadatas)

View file

@ -127,7 +127,7 @@ _free_mapping (ChildMapping * mapping)
gst_object_unref (child);
}
g_slice_free (ChildMapping, mapping);
g_free (mapping);
}
static gint
@ -347,7 +347,7 @@ _deep_copy (GESTimelineElement * element, GESTimelineElement * copy)
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = tmp->next) {
ChildMapping *map, *orig_map;
orig_map = g_hash_table_lookup (self->priv->mappings, tmp->data);
map = g_slice_new0 (ChildMapping);
map = g_new0 (ChildMapping, 1);
map->child = ges_timeline_element_copy (tmp->data, TRUE);
map->start_offset = orig_map->start_offset;
@ -758,7 +758,7 @@ ges_container_add (GESContainer * container, GESTimelineElement * child)
}
}
mapping = g_slice_new0 (ChildMapping);
mapping = g_new0 (ChildMapping, 1);
mapping->child = gst_object_ref (child);
g_hash_table_insert (priv->mappings, child, mapping);
container->children = g_list_append (container->children, child);

View file

@ -434,7 +434,7 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, NewAssetUData * udata)
gst_object_unref (asset);
gst_object_unref (udata->clip);
g_slice_free (NewAssetUData, udata);
g_free (udata);
}
/**
@ -714,7 +714,7 @@ ges_layer_add_clip_full (GESLayer * layer, GESClip * clip, GError ** error)
asset = ges_extractable_get_asset (GES_EXTRACTABLE (clip));
if (asset == NULL) {
gchar *id;
NewAssetUData *mudata = g_slice_new (NewAssetUData);
NewAssetUData *mudata = g_new (NewAssetUData, 1);
mudata->clip = clip;
mudata->layer = layer;
@ -743,7 +743,7 @@ ges_layer_add_clip_full (GESLayer * layer, GESClip * clip, GError ** error)
ges_extractable_set_asset (GES_EXTRACTABLE (clip), asset);
g_slice_free (NewAssetUData, mudata);
g_free (mudata);
gst_clear_object (&asset);
}

View file

@ -110,19 +110,19 @@ _free_meta_container_data (ContainerData * data)
gst_structure_free (data->structure);
g_hash_table_unref (data->static_items);
g_slice_free (ContainerData, data);
g_free (data);
}
static void
_free_static_item (RegisteredMeta * item)
{
g_slice_free (RegisteredMeta, item);
g_free (item);
}
static ContainerData *
_create_container_data (GESMetaContainer * container)
{
ContainerData *data = g_slice_new (ContainerData);
ContainerData *data = g_new (ContainerData, 1);
data->structure = gst_structure_new_empty ("metadatas");
data->static_items = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify) (GDestroyNotify) _free_static_item);
@ -216,7 +216,7 @@ _register_meta (GESMetaContainer * container, GESMetaFlag flags,
return FALSE;
}
static_item = g_slice_new0 (RegisteredMeta);
static_item = g_new0 (RegisteredMeta, 1);
static_item->item_type = type;
static_item->flags = flags;
g_hash_table_insert (data->static_items, g_strdup (meta_item), static_item);

View file

@ -140,7 +140,7 @@ _emit_loaded_in_idle (EmitLoadedInIdle * data)
gst_object_unref (data->project);
gst_object_unref (data->timeline);
g_slice_free (EmitLoadedInIdle, data);
g_free (data);
return FALSE;
}
@ -226,7 +226,7 @@ _load_project (GESProject * project, GESTimeline * timeline, GError ** error)
ges_project_set_uri (project, ges_asset_get_id (GES_ASSET (project)));
GST_INFO_OBJECT (project, "Using asset ID %s as URI.", priv->uri);
} else {
EmitLoadedInIdle *data = g_slice_new (EmitLoadedInIdle);
EmitLoadedInIdle *data = g_new (EmitLoadedInIdle, 1);
GST_INFO_OBJECT (project, "%s, Loading an empty timeline %s"
" as no URI set yet", GST_OBJECT_NAME (timeline),

View file

@ -71,7 +71,7 @@ destroy_pad (PadInfos * infos)
gst_element_release_request_pad (infos->self->adder, infos->adder_pad);
gst_object_unref (infos->adder_pad);
}
g_slice_free (PadInfos, infos);
g_free (infos);
}
/****************************************************
@ -84,7 +84,7 @@ _request_new_pad (GstElement * element, GstPadTemplate * templ,
GstPad *audioresample_srcpad, *audioconvert_sinkpad, *tmpghost;
GstPad *ghost;
GstElement *audioconvert, *audioresample;
PadInfos *infos = g_slice_new0 (PadInfos);
PadInfos *infos = g_new0 (PadInfos, 1);
GESSmartAdder *self = GES_SMART_ADDER (element);
infos->adder_pad = gst_element_request_pad (self->adder,
@ -93,7 +93,7 @@ _request_new_pad (GstElement * element, GstPadTemplate * templ,
if (infos->adder_pad == NULL) {
GST_WARNING_OBJECT (element, "Could not get any pad from GstAdder");
g_slice_free (PadInfos, infos);
g_free (infos);
return NULL;
}

View file

@ -401,7 +401,7 @@ _child_prop_handler_free (ChildPropHandler * handler)
if (handler->child != (GObject *) handler->self &&
handler->child != (GObject *) handler->owner)
gst_object_unref (handler->child);
g_slice_free (ChildPropHandler, handler);
g_free (handler);
}
static gboolean
@ -763,7 +763,7 @@ emit_deep_notify_in_idle (EmitDeepNotifyInIdleData * data)
gst_object_unref (data->child);
g_param_spec_unref (data->arg);
gst_object_unref (data->self);
g_slice_free (EmitDeepNotifyInIdleData, data);
g_free (data);
return FALSE;
}
@ -782,7 +782,7 @@ child_prop_changed_cb (GObject * child, GParamSpec * arg,
return;
}
data = g_slice_new (EmitDeepNotifyInIdleData);
data = g_new (EmitDeepNotifyInIdleData, 1);
data->child = gst_object_ref (child);
data->arg = g_param_spec_ref (arg);
@ -845,7 +845,7 @@ ges_timeline_element_add_child_property_full (GESTimelineElement * self,
child, pspec->name);
signame = g_strconcat ("notify::", pspec->name, NULL);
handler = (ChildPropHandler *) g_slice_new0 (ChildPropHandler);
handler = (ChildPropHandler *) g_new0 (ChildPropHandler, 1);
handler->self = self;
if (child == G_OBJECT (self) || child == G_OBJECT (owner))
handler->child = child;

View file

@ -173,7 +173,7 @@ gap_new (GESTrack * track, GstClockTime start, GstClockTime duration)
return NULL;
}
new_gap = g_slice_new (Gap);
new_gap = g_new (Gap, 1);
new_gap->start = start;
new_gap->duration = duration;
new_gap->track = track;
@ -201,7 +201,7 @@ free_gap (Gap * gap)
GST_TIME_ARGS (gap->duration));
ges_nle_composition_remove_object (track->priv->composition, gap->nleobj);
g_slice_free (Gap, gap);
g_free (gap);
}
static inline void

View file

@ -339,7 +339,7 @@ _parse_asset (GMarkupParseContext * context, const gchar * element_name,
extractable_type = g_type_from_name (extractable_type_name);
if (extractable_type == GES_TYPE_TIMELINE) {
SubprojectData *subproj_data = g_malloc0 (sizeof (SubprojectData));
SubprojectData *subproj_data = g_new0 (SubprojectData, 1);
const gchar *nid;
priv->subproject = subproj_data;

View file

@ -160,7 +160,7 @@ check_destroyed (GObject * object_to_unref, GObject * first_object, ...)
{
GObject *object;
GList *objs = NULL, *tmp;
DestroyedObjectStruct *destroyed = g_slice_new0 (DestroyedObjectStruct);
DestroyedObjectStruct *destroyed = g_new0 (DestroyedObjectStruct, 1);
destroyed->object = object_to_unref;
g_object_weak_ref (object_to_unref, (GWeakNotify) weak_notify, destroyed);
@ -173,7 +173,7 @@ check_destroyed (GObject * object_to_unref, GObject * first_object, ...)
va_start (varargs, first_object);
while (object) {
destroyed = g_slice_new0 (DestroyedObjectStruct);
destroyed = g_new0 (DestroyedObjectStruct, 1);
destroyed->object = object;
g_object_weak_ref (object, (GWeakNotify) weak_notify, destroyed);
objs = g_list_prepend (objs, destroyed);
@ -186,7 +186,7 @@ check_destroyed (GObject * object_to_unref, GObject * first_object, ...)
for (tmp = objs; tmp; tmp = tmp->next) {
fail_unless (((DestroyedObjectStruct *) tmp->data)->destroyed == TRUE,
"%p is not destroyed", ((DestroyedObjectStruct *) tmp->data)->object);
g_slice_free (DestroyedObjectStruct, tmp->data);
g_free (tmp->data);
}
g_list_free (objs);