mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
miniobject: Directly increate mini_object in mini_object_free()
Speeds up mini_object_unref by 25% by avoiding the typecheck which is avoidable here since it is only called on existing miniobjects.
This commit is contained in:
parent
89d3da6cba
commit
2c4afb966d
1 changed files with 5 additions and 1 deletions
|
@ -324,7 +324,11 @@ gst_mini_object_free (GstMiniObject * mini_object)
|
||||||
/* At this point, the refcount of the object is 0. We increase the refcount
|
/* At this point, the refcount of the object is 0. We increase the refcount
|
||||||
* here because if a subclass recycles the object and gives out a new
|
* here because if a subclass recycles the object and gives out a new
|
||||||
* reference we don't want to free the instance anymore. */
|
* reference we don't want to free the instance anymore. */
|
||||||
gst_mini_object_ref (mini_object);
|
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p ref %d->%d", mini_object,
|
||||||
|
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object),
|
||||||
|
GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) + 1);
|
||||||
|
|
||||||
|
g_atomic_int_inc (&mini_object->refcount);
|
||||||
|
|
||||||
mo_class = GST_MINI_OBJECT_GET_CLASS (mini_object);
|
mo_class = GST_MINI_OBJECT_GET_CLASS (mini_object);
|
||||||
mo_class->finalize (mini_object);
|
mo_class->finalize (mini_object);
|
||||||
|
|
Loading…
Reference in a new issue